From 1c7ad3ea09cad6a11ffe9b94e81c9e8112c2ee17 Mon Sep 17 00:00:00 2001 From: Yair Volloch <87264348+yairvol@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:15:24 +0200 Subject: [PATCH] Revert "bugfix/AX-62610_short_axon_id_appears_in_exported_get (#308)" This reverts commit 0c34cca0ac3381236543102c044d10819f0f012b. --- .../api/asset_callbacks/base.py | 22 ++++--------------- axonius_api_client/constants/fields.py | 9 -------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/axonius_api_client/api/asset_callbacks/base.py b/axonius_api_client/api/asset_callbacks/base.py index ce08b90..e356a44 100644 --- a/axonius_api_client/api/asset_callbacks/base.py +++ b/axonius_api_client/api/asset_callbacks/base.py @@ -15,8 +15,6 @@ FIELDS_DETAILS_EXCLUDE, FIELDS_ENTITY_PASSTHRU, SCHEMAS_CUSTOM, - EXCLUDED_DEFAULT_FIELDS_MAP, - ALL_FIELDS_KEY, ) from ...exceptions import ApiError from ...tools import ( @@ -268,7 +266,10 @@ def start(self, **kwargs): ) self.STORE["include_details"] = include_details = True - self._expand_field_excludes(excludes=excludes, include_details=include_details) + if include_details: + missing = [x for x in FIELDS_DETAILS_EXCLUDE if x not in excludes] + self.echo(msg=f"Adding fields {missing} to field_excludes: {excludes}", debug=True) + self.set_arg_value("field_excludes", value=excludes + missing) cb_args = crjoin(join_kv(obj=self.GETARGS)) self.LOG.debug(f"Get Extra Arguments: {cb_args}") @@ -279,21 +280,6 @@ def start(self, **kwargs): store = crjoin(join_kv(obj=self.STORE)) self.echo(msg=f"Get Arguments: {store}") - def _expand_field_excludes(self, excludes: list, include_details: bool): - # enriches the excluded fields param when necessary - if include_details: - missing = [x for x in FIELDS_DETAILS_EXCLUDE if x not in excludes] - self.echo(msg=f"Adding fields {missing} to field_excludes: {excludes}", debug=True) - self.set_arg_value("field_excludes", value=excludes + missing) - - fields = listify(self.STORE.get("fields", [])) - should_not_exclude_fields = ALL_FIELDS_KEY in fields - if should_not_exclude_fields: - return - default_fields_to_exclude = [field[1] for field in EXCLUDED_DEFAULT_FIELDS_MAP if field[0] not in fields] - if default_fields_to_exclude: - self.set_arg_value("field_excludes", value=excludes + default_fields_to_exclude) - # noinspection PyUnusedLocal def echo_columns(self, **kwargs): """Echo the columns of the fields selected.""" diff --git a/axonius_api_client/constants/fields.py b/axonius_api_client/constants/fields.py index c73fa39..6f244a2 100644 --- a/axonius_api_client/constants/fields.py +++ b/axonius_api_client/constants/fields.py @@ -103,15 +103,6 @@ def is_axid(value: t.Any) -> bool: ] """Fields that should be excluded when include_details=True""" -EXCLUDED_DEFAULT_FIELDS_MAP: t.List[tuple] = [ - ("agg:short_axon_id", "short_axon_id"), - ("agg:axon_id", "specific_data.data.axon_id"), -] -"""Fields that are manually excluded unless specifically requested""" - -ALL_FIELDS_KEY: str = "agg:all" -"""Field that's being used to retrieve all fields from entities""" - FIELDS_ENTITY_PASSTHRU: t.List[str] = [ "adapter_list_length", "internal_axon_id",