Skip to content

Commit 4982c8a

Browse files
committed
fixing deprecated _fields_
1 parent 0589a6d commit 4982c8a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

nodescraper/pluginexecutor.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,26 @@ def apply_global_args_to_plugin(
243243
else:
244244
run_args[key] = global_args[key]
245245

246-
if "collection_args" in global_args and hasattr(plugin_class, "COLLECTOR_ARGS"):
247-
plugin_fields = set(plugin_class.COLLECTOR_ARGS.__fields__.keys())
246+
if (
247+
"collection_args" in global_args
248+
and hasattr(plugin_class, "COLLECTOR_ARGS")
249+
and plugin_class.COLLECTOR_ARGS is not None
250+
):
251+
252+
plugin_fields = set(plugin_class.COLLECTOR_ARGS.model_fields.keys())
248253
filtered = {
249254
k: v for k, v in global_args["collection_args"].items() if k in plugin_fields
250255
}
251256
if filtered:
252257
run_args["collection_args"] = filtered
253258

254-
if "analysis_args" in global_args and hasattr(plugin_class, "ANALYZER_ARGS"):
255-
plugin_fields = set(plugin_class.ANALYZER_ARGS.__fields__.keys())
259+
if (
260+
"analysis_args" in global_args
261+
and hasattr(plugin_class, "ANALYZER_ARGS")
262+
and plugin_class.ANALYZER_ARGS is not None
263+
):
264+
265+
plugin_fields = set(plugin_class.ANALYZER_ARGS.model_fields.keys())
256266
filtered = {k: v for k, v in global_args["analysis_args"].items() if k in plugin_fields}
257267
if filtered:
258268
run_args["analysis_args"] = filtered

0 commit comments

Comments
 (0)