binarycat0 commented on code in PR #2812:
URL: https://github.com/apache/polaris/pull/2812#discussion_r2486541802
##########
client/python/integration_tests/conftest.py:
##########
@@ -379,31 +381,37 @@ def format_namespace(namespace: List[str]) -> str:
def _patch_generated_models() -> None:
"""
The OpenAPI generator creates an `api_client` that dynamically looks up
- model classes from the `polaris.catalog.models` module using `getattr()`.
+ model classes from the `apache_polaris.sdk.catalog.models` module using
`getattr()`.
For example, when a response for a `create_policy` call is received, the
deserializer tries to find the `LoadPolicyResponse` class by looking for
- `polaris.catalog.models.LoadPolicyResponse`.
+ `apache_polaris.sdk.catalog.models.LoadPolicyResponse`.
However, the generator fails to add the necessary `import` statements
to the `polaris/catalog/models/__init__.py` file. This means that even
though the model files exist (e.g., `load_policy_response.py`), the classes
- are not part of the `polaris.catalog.models` namespace.
+ are not part of the `apache_polaris.sdk.catalog.models` namespace.
This fixture works around the bug in the generated code without modifying
the source files. It runs once per test session, before any tests, and
manually injects the missing response-side model classes into the
- `polaris.catalog.models` namespace, allowing the deserializer to find them.
+ `apache_polaris.sdk.catalog.models` namespace, allowing the deserializer
to find them.
"""
- import polaris.catalog.models
- from polaris.catalog.models.applicable_policy import ApplicablePolicy
- from polaris.catalog.models.get_applicable_policies_response import (
+ import apache_polaris.sdk.catalog.models
+ from apache_polaris.sdk.catalog.models.applicable_policy import
ApplicablePolicy
+ from apache_polaris.sdk.catalog.models.get_applicable_policies_response
import (
GetApplicablePoliciesResponse,
)
- from polaris.catalog.models.list_policies_response import
ListPoliciesResponse
- from polaris.catalog.models.load_policy_response import LoadPolicyResponse
- from polaris.catalog.models.policy import Policy
- from polaris.catalog.models.policy_attachment_target import
PolicyAttachmentTarget
- from polaris.catalog.models.policy_identifier import PolicyIdentifier
+ from apache_polaris.sdk.catalog.models.list_policies_response import (
Review Comment:
Made automatically by `make client-lint`. It follows the black code style.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]