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

bug: Incorrect table name resolved if stream name is hyphenated #2909

Open
1 task
ReubenFrankel opened this issue Mar 20, 2025 · 1 comment
Open
1 task
Assignees

Comments

@ReubenFrankel
Copy link
Contributor

Singer SDK Version

0.44.3

Is this a regression?

  • Yes

Python Version

NA

Bug scope

Targets (data type handling, batching, SQL object generation, etc.)

Operating System

No response

Description

For SQL targets, if a stream name is hyphenated it is assumed to be fully-qualified and the part after the last hyphen is taken as the table name. In our case, we have a tap stream name of tap_bigquery-weekly_fuel_prices and expect a table of name in similar shape to be created in Snowflake - instead, weekly_fuel_prices is resolved which is not desirable is our case. Is there a reason for this behaviour?

@property
def table_name(self) -> str:
"""Return the table name, with no schema or database part.
Returns:
The target table name.
"""
parts = self.stream_name.split("-")
table = self.stream_name if len(parts) == 1 else parts[-1]
return self.conform_name(table, "table")

Link to Slack/Linen

No response

@ReubenFrankel
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants