diff --git a/docs/QueryRequest.md b/docs/QueryRequest.md index 9b36875..00ed64e 100644 --- a/docs/QueryRequest.md +++ b/docs/QueryRequest.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **var_async** | **bool** | When true, execute the query asynchronously and return a query run ID for polling via GET /query-runs/{id}. The query results can be retrieved via GET /results/{id} once the query run status is \"succeeded\". | [optional] **async_after_ms** | **int** | If set with async=true, wait up to this many milliseconds for the query to complete synchronously before returning an async response. Minimum 1000ms. Ignored if async is false. | [optional] +**default_catalog** | **str** | Catalog that unqualified table references resolve against. Only honored inside an `X-Database-Id` scope; sending it without that header is a 400. Must name a catalog visible in the database (`default`, an attached catalog alias, or a system catalog). Defaults to `default` when omitted. | [optional] +**default_schema** | **str** | Schema that unqualified table references resolve against. Only honored inside an `X-Database-Id` scope; sending it without that header is a 400. Defaults to `main` when omitted. Existence is not validated up front — an unknown schema surfaces as a \"table not found\" error at planning time. | [optional] **sql** | **str** | | ## Example diff --git a/hotdata/api_client.py b/hotdata/api_client.py index 07e72e8..b1bc64b 100644 --- a/hotdata/api_client.py +++ b/hotdata/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.2.3/python' + self.user_agent = 'OpenAPI-Generator/0.2.5/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/hotdata/models/query_request.py b/hotdata/models/query_request.py index eeba954..a956105 100644 --- a/hotdata/models/query_request.py +++ b/hotdata/models/query_request.py @@ -30,8 +30,10 @@ class QueryRequest(BaseModel): """ # noqa: E501 var_async: Optional[StrictBool] = Field(default=None, description="When true, execute the query asynchronously and return a query run ID for polling via GET /query-runs/{id}. The query results can be retrieved via GET /results/{id} once the query run status is \"succeeded\".", alias="async") async_after_ms: Optional[Annotated[int, Field(strict=True, ge=1000)]] = Field(default=None, description="If set with async=true, wait up to this many milliseconds for the query to complete synchronously before returning an async response. Minimum 1000ms. Ignored if async is false.") + default_catalog: Optional[StrictStr] = Field(default=None, description="Catalog that unqualified table references resolve against. Only honored inside an `X-Database-Id` scope; sending it without that header is a 400. Must name a catalog visible in the database (`default`, an attached catalog alias, or a system catalog). Defaults to `default` when omitted.") + default_schema: Optional[StrictStr] = Field(default=None, description="Schema that unqualified table references resolve against. Only honored inside an `X-Database-Id` scope; sending it without that header is a 400. Defaults to `main` when omitted. Existence is not validated up front — an unknown schema surfaces as a \"table not found\" error at planning time.") sql: StrictStr - __properties: ClassVar[List[str]] = ["async", "async_after_ms", "sql"] + __properties: ClassVar[List[str]] = ["async", "async_after_ms", "default_catalog", "default_schema", "sql"] model_config = ConfigDict( populate_by_name=True, @@ -77,6 +79,16 @@ def to_dict(self) -> Dict[str, Any]: if self.async_after_ms is None and "async_after_ms" in self.model_fields_set: _dict['async_after_ms'] = None + # set to None if default_catalog (nullable) is None + # and model_fields_set contains the field + if self.default_catalog is None and "default_catalog" in self.model_fields_set: + _dict['default_catalog'] = None + + # set to None if default_schema (nullable) is None + # and model_fields_set contains the field + if self.default_schema is None and "default_schema" in self.model_fields_set: + _dict['default_schema'] = None + return _dict @classmethod @@ -91,6 +103,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "async": obj.get("async"), "async_after_ms": obj.get("async_after_ms"), + "default_catalog": obj.get("default_catalog"), + "default_schema": obj.get("default_schema"), "sql": obj.get("sql") }) return _obj