Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/QueryRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hotdata/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
16 changes: 15 additions & 1 deletion hotdata/models/query_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down