Skip to content

Commit

Permalink
refactor: Renamed SQLConnector.type_mapping to `SQLConnector.sql_to…
Browse files Browse the repository at this point in the history
…_jsonschema` (#2652)
  • Loading branch information
edgarrmondragon authored Sep 6, 2024
1 parent 7ea1422 commit ae86c53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit ae86c53

Please sign in to comment.