Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Renamed SQLConnector.type_mapping to SQLConnector.sql_to_jsonschema #2652

Merged
merged 1 commit into from
Sep 6, 2024
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: 1 addition & 1 deletion docs/guides/sql-tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ Then, you need to use your custom type mapping in your connector:
```python
class MyConnector(SQLConnector):
@functools.cached_property
def type_mapping(self):
def sql_to_jsonschema(self):
return CustomSQLToJSONSchema()
```
4 changes: 2 additions & 2 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def logger(self) -> logging.Logger:
return logging.getLogger("sqlconnector")

@functools.cached_property
def type_mapping(self) -> SQLToJSONSchema:
def sql_to_jsonschema(self) -> SQLToJSONSchema:
"""Return the type mapper object.

Override this method to provide a custom mapping for your SQL dialect.
Expand Down Expand Up @@ -383,7 +383,7 @@ def to_jsonschema_type(
The JSON Schema representation of the provided type.
"""
if isinstance(sql_type, sa.types.TypeEngine):
return self.type_mapping.to_jsonschema(sql_type)
return self.sql_to_jsonschema.to_jsonschema(sql_type)

if isinstance(sql_type, str): # pragma: no cover
warnings.warn(
Expand Down
Loading