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 gooddata-api-client/docs/ActionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4214,6 +4214,7 @@ with gooddata_api_client.ApiClient() as api_client:
data_type="INT",
description="Customer unique identifier",
name="customer_id",
null_value="null_value_example",
),
],
statement="select * from abc",
Expand Down Expand Up @@ -4242,6 +4243,7 @@ with gooddata_api_client.ApiClient() as api_client:
is_nullable=True,
is_primary_key=True,
name="customer_id",
null_value="null_value_example",
referenced_table_column="customer_id",
referenced_table_id="customers",
),
Expand Down
1 change: 1 addition & 0 deletions gooddata-api-client/docs/DeclarativeColumn.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**description** | **str** | Column description/comment from database | [optional]
**is_nullable** | **bool** | Column is nullable | [optional]
**is_primary_key** | **bool** | Is column part of primary key? | [optional]
**null_value** | **str** | Value used as sentinel for nullable columns | [optional]
**referenced_table_column** | **str** | Referenced table (Foreign key) | [optional]
**referenced_table_id** | **str** | Referenced table (Foreign key) | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
Expand Down
2 changes: 2 additions & 0 deletions gooddata-api-client/docs/GenerateLogicalDataModelApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ with gooddata_api_client.ApiClient() as api_client:
data_type="INT",
description="Customer unique identifier",
name="customer_id",
null_value="null_value_example",
),
],
statement="select * from abc",
Expand Down Expand Up @@ -83,6 +84,7 @@ with gooddata_api_client.ApiClient() as api_client:
is_nullable=True,
is_primary_key=True,
name="customer_id",
null_value="null_value_example",
referenced_table_column="customer_id",
referenced_table_id="customers",
),
Expand Down
1 change: 1 addition & 0 deletions gooddata-api-client/docs/SqlColumn.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**data_type** | **str** | Column type |
**name** | **str** | Column name |
**description** | **str** | Column description/comment from database | [optional]
**null_value** | **str** | Value used as sentinel for null values in the column | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def openapi_types():
'description': (str,), # noqa: E501
'is_nullable': (bool,), # noqa: E501
'is_primary_key': (bool,), # noqa: E501
'null_value': (str,), # noqa: E501
'referenced_table_column': (str,), # noqa: E501
'referenced_table_id': (str,), # noqa: E501
}
Expand All @@ -124,6 +125,7 @@ def discriminator():
'description': 'description', # noqa: E501
'is_nullable': 'isNullable', # noqa: E501
'is_primary_key': 'isPrimaryKey', # noqa: E501
'null_value': 'nullValue', # noqa: E501
'referenced_table_column': 'referencedTableColumn', # noqa: E501
'referenced_table_id': 'referencedTableId', # noqa: E501
}
Expand Down Expand Up @@ -176,6 +178,7 @@ def _from_openapi_data(cls, data_type, name, *args, **kwargs): # noqa: E501
description (str): Column description/comment from database. [optional] # noqa: E501
is_nullable (bool): Column is nullable. [optional] # noqa: E501
is_primary_key (bool): Is column part of primary key?. [optional] # noqa: E501
null_value (str): Value used as sentinel for nullable columns. [optional] # noqa: E501
referenced_table_column (str): Referenced table (Foreign key). [optional] # noqa: E501
referenced_table_id (str): Referenced table (Foreign key). [optional] # noqa: E501
"""
Expand Down Expand Up @@ -272,6 +275,7 @@ def __init__(self, data_type, name, *args, **kwargs): # noqa: E501
description (str): Column description/comment from database. [optional] # noqa: E501
is_nullable (bool): Column is nullable. [optional] # noqa: E501
is_primary_key (bool): Is column part of primary key?. [optional] # noqa: E501
null_value (str): Value used as sentinel for nullable columns. [optional] # noqa: E501
referenced_table_column (str): Referenced table (Foreign key). [optional] # noqa: E501
referenced_table_id (str): Referenced table (Foreign key). [optional] # noqa: E501
"""
Expand Down
4 changes: 4 additions & 0 deletions gooddata-api-client/gooddata_api_client/model/sql_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def openapi_types():
'data_type': (str,), # noqa: E501
'name': (str,), # noqa: E501
'description': (str,), # noqa: E501
'null_value': (str,), # noqa: E501
}

@cached_property
Expand All @@ -106,6 +107,7 @@ def discriminator():
'data_type': 'dataType', # noqa: E501
'name': 'name', # noqa: E501
'description': 'description', # noqa: E501
'null_value': 'nullValue', # noqa: E501
}

read_only_vars = {
Expand Down Expand Up @@ -154,6 +156,7 @@ def _from_openapi_data(cls, data_type, name, *args, **kwargs): # noqa: E501
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
description (str): Column description/comment from database. [optional] # noqa: E501
null_value (str): Value used as sentinel for null values in the column. [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down Expand Up @@ -246,6 +249,7 @@ def __init__(self, data_type, name, *args, **kwargs): # noqa: E501
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
description (str): Column description/comment from database. [optional] # noqa: E501
null_value (str): Value used as sentinel for null values in the column. [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class SqlColumn(Base):
data_type: str
name: str
null_value: str | None = None

@staticmethod
def client_class() -> type[ApiSqlColumn]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interactions:
columns:
- dataType: INT
name: campaign_id
nullValue: '0'
headers:
Content-Type:
- application/json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ interactions:
columns:
- dataType: INT
name: product_id
nullValue: '0'
- dataType: STRING
name: product_name
nullValue: _
- dataType: STRING
name: category
nullValue: _
dataPreview:
- - '150'
- Skirt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interactions:
columns:
- dataType: INT
name: campaign_id
nullValue: '0'
dataPreview:
- - null
- - null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ def test_scan_sql(test_config: dict):

assert len(response.columns) == 3
assert response.columns == [
SqlColumn(name="category", data_type="STRING"),
SqlColumn(name="product_id", data_type="INT"),
SqlColumn(name="product_name", data_type="STRING"),
SqlColumn(name="category", data_type="STRING", null_value="_"),
SqlColumn(name="product_id", data_type="INT", null_value="0"),
SqlColumn(name="product_name", data_type="STRING", null_value="_"),
]
assert len(response.data_preview) == 10

Expand All @@ -746,7 +746,7 @@ def test_scan_sql_with_nulls_in_preview(test_config: dict):

assert len(response.columns) == 1
assert response.columns == [
SqlColumn(name="campaign_id", data_type="INT"),
SqlColumn(name="campaign_id", data_type="INT", null_value="0"),
]
assert len(response.data_preview) == 5
assert [None] in response.data_preview
Expand All @@ -763,7 +763,7 @@ def test_scan_sql_without_preview(test_config: dict):

assert len(response.columns) == 1
assert response.columns == [
SqlColumn(name="campaign_id", data_type="INT"),
SqlColumn(name="campaign_id", data_type="INT", null_value="0"),
]
assert response.data_preview is None

Expand Down
8 changes: 8 additions & 0 deletions schemas/gooddata-api-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -5836,6 +5836,10 @@
"maxLength": 255,
"type": "string"
},
"nullValue": {
"description": "Value used as sentinel for nullable columns",
"type": "string"
},
"referencedTableColumn": {
"description": "Referenced table (Foreign key)",
"example": "customer_id",
Expand Down Expand Up @@ -34017,6 +34021,10 @@
"description": "Column name",
"example": "customer_id",
"type": "string"
},
"nullValue": {
"description": "Value used as sentinel for null values in the column",
"type": "string"
}
},
"required": [
Expand Down
8 changes: 8 additions & 0 deletions schemas/gooddata-scan-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@
"maxLength": 255,
"type": "string"
},
"nullValue": {
"description": "Value used as sentinel for nullable columns",
"type": "string"
},
"referencedTableColumn": {
"description": "Referenced table (Foreign key)",
"example": "customer_id",
Expand Down Expand Up @@ -544,6 +548,10 @@
"description": "Column name",
"example": "customer_id",
"type": "string"
},
"nullValue": {
"description": "Value used as sentinel for null values in the column",
"type": "string"
}
},
"required": [
Expand Down
Loading