Skip to content

Commit

Permalink
added fix for transform_column_name and changed code to pass test (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
loveeklund-osttra authored Sep 30, 2024
1 parent 2f770e9 commit 9d1d0b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions target_bigquery/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ def generate_view_statement(self, table_name: BigQueryTable) -> str:
)

return (
f"CREATE OR REPLACE VIEW {table_name.get_escaped_name('_view')} AS \nSELECT"
f" \n{projection} FROM {table_name.get_escaped_name()}"
f"CREATE OR REPLACE VIEW {table_name.get_escaped_name('_view')} AS\nSELECT"
f"\n{projection} FROM {table_name.get_escaped_name()}"
)

def _jsonschema_property_to_bigquery_column(
Expand Down Expand Up @@ -1084,8 +1084,12 @@ def transform_column_name(
add_underscore_when_invalid: bool = False,
snake_case: bool = False,
replace_period_with_underscore: bool = False,
**kwargs
) -> str:
"""Transform a column name to a valid BigQuery column name."""
"""Transform a column name to a valid BigQuery column name.
kwargs is here to handle unspecified column tranforms, this can become an issue if config is added in main
branch but code is versioned to run on an old commit.
"""
if snake_case and not lower:
lower = True
was_quoted = name.startswith("`") and name.endswith("`")
Expand Down

0 comments on commit 9d1d0b0

Please sign in to comment.