Adam/epd 2068 update python sdk for self hosted deployments (#360) - #362
Closed
josorio-autoblocks wants to merge 1 commit into
Closed
Conversation
* Update env variable * Update env variable * Update auto tracer
There was a problem hiding this comment.
6 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
|
|
||
| API_ENDPOINT = "https://api.autoblocks.ai" | ||
| API_ENDPOINT_V2 = "https://api-v2.autoblocks.ai" | ||
| API_ENDPOINT_V2 = AutoblocksEnvVar.V2_API_ENDPOINT_V2.get() or "https://api-v2.autoblocks.ai" |
There was a problem hiding this comment.
logic: Consider what happens if get() returns an empty string - would still fallback to default URL as intended?
Comment on lines
+39
to
+61
| @field_validator("schema_properties", mode="before") | ||
| @classmethod | ||
| def validate_schema_properties(cls, v: Optional[List[Dict[str, Any]]]) -> Optional[List[SchemaProperty]]: | ||
| """Validate and convert schema properties using factory function""" | ||
| if v is None: | ||
| return None | ||
|
|
||
| if not isinstance(v, list): | ||
| return v | ||
|
|
||
| result = [] | ||
| for item in v: | ||
| if isinstance(item, dict): | ||
| try: | ||
| result.append(create_schema_property(item)) | ||
| except (ValueError, TypeError): | ||
| # If we can't parse a specific property, skip it rather than failing entirely | ||
| # This provides better resilience against API changes | ||
| continue | ||
| else: | ||
| result.append(item) | ||
|
|
||
| return result |
There was a problem hiding this comment.
style: Duplicate validation logic between Dataset and DatasetSchema classes. Consider extracting to a shared validator function to maintain DRY principles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update env variable
Update env variable
Update auto tracer
Greptile Summary
Updates the Python SDK to support self-hosted deployments by making the V2 API endpoint configurable and adds default value support for schema properties.
autoblocks/_impl/config/constants.pyto make V2 API endpoint configurable viaAUTOBLOCKS_V2_API_ENDPOINTenvironment variabledefault_valuefield toautoblocks/_impl/datasets/models/schema.pyBaseSchemaProperty class for specifying default valuesautoblocks/_impl/tracer/auto_tracer.pyto use configurable API endpoint for trace collectionautoblocks/_impl/datasets/models/dataset.pyto handle schema property validation more gracefullytests/autoblocks/test_app_client_datasets.pyfor testing schema property deserialization with default values