diff --git a/README.md b/README.md index 0bd66fc..a6c2971 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,6 @@ Get your [free API key here](https://flipsidecrypto.xyz/account/api-keys) | Language | Version | Status | | ------------------------ | ------- | ---------------------------------------------------------------------------------- | -| ✅ [Python](./python/) | 2.0.4 | [![tests](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_python.yml/badge.svg)](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_python.yml) | +| ✅ [Python](./python/) | 2.0.7 | [![tests](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_python.yml/badge.svg)](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_python.yml) | | ✅ [JS/TypeScript](./js) | 2.0.0 | [![tests](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_js.yml/badge.svg)](https://github.com/FlipsideCrypto/sdk/actions/workflows/ci_js.yml) | ✅ [R](./r/shroomDK/) | Under Construction | | diff --git a/python/VERSION b/python/VERSION index b9d2bdf..6a0ca2d 100644 --- a/python/VERSION +++ b/python/VERSION @@ -1 +1 @@ -2.0.5 \ No newline at end of file +2.0.7 \ No newline at end of file diff --git a/python/src/integrations/query_integration/compass_query_integration.py b/python/src/integrations/query_integration/compass_query_integration.py index 911c0aa..8c5d729 100644 --- a/python/src/integrations/query_integration/compass_query_integration.py +++ b/python/src/integrations/query_integration/compass_query_integration.py @@ -159,19 +159,19 @@ class CompassQueryIntegration(object): filters: Optional[Union[List[Filter], None]] = [], sort_by: Optional[Union[List[SortBy], None]] = [], ) -> GetQueryRunResultsRpcResult: - query_results_resp = self.rpc.get_query_result( - GetQueryRunResultsRpcParams( - queryRunId=query_run_id, - format=ResultFormat.csv, - page=Page( - number=page_number, - size=page_size, - ), - filters=filters, - sortBy=sort_by, - ) + params = GetQueryRunResultsRpcParams( + queryRunId=query_run_id, + format=ResultFormat.csv, + page=Page( + number=page_number, + size=page_size, + ), + filters=filters, + sortBy=sort_by, ) + query_results_resp = self.rpc.get_query_result(params) + if query_results_resp.error: raise get_exception_by_error_code( error_code=query_results_resp.error.code diff --git a/python/src/models/compass/get_query_run_results.py b/python/src/models/compass/get_query_run_results.py index fbbd77c..160f5e4 100644 --- a/python/src/models/compass/get_query_run_results.py +++ b/python/src/models/compass/get_query_run_results.py @@ -13,22 +13,25 @@ from .core.rpc_response import RpcResponse # Request class Filter(BaseModel): column: str - eq: Optional[str] = None - neq: Optional[str] = None - gt: Optional[str] = None - gte: Optional[str] = None - lt: Optional[str] = None - lte: Optional[str] = None - like: Optional[str] = None - in_: Optional[List[str]] = None - notIn: Optional[List[str]] = None + eq: Optional[Any] = None + neq: Optional[Any] = None + gt: Optional[Any] = None + gte: Optional[Any] = None + lt: Optional[Any] = None + lte: Optional[Any] = None + like: Optional[Any] = None + in_: Optional[List[Any]] = None + notIn: Optional[List[Any]] = None class Config: fields = {"in_": "in"} def dict(self, *args, **kwargs) -> dict: kwargs.setdefault("exclude_none", True) # Exclude keys with None values - return super().dict(*args, **kwargs) + result = super().dict(*args, **kwargs) + if "in_" in result: + result["in"] = result.pop("in_") # convert 'in_' back to 'in' + return result class SortBy(BaseModel):