Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-dell committed Sep 9, 2024
1 parent cf92ef2 commit 4027e64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions awswrangler/redshift/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ def _get_rsh_columns_types(
return redshift_types


def _add_new_columns(
def _add_new_table_columns(
cursor: "redshift_connector.Cursor", schema: str, table: str, redshift_columns_types: dict[str, str]
):
) -> None:
# Check if the cluster is configured as case sensitive or no
is_case_sensitive = False
if _get_parameter_setting(cursor=cursor, parameter_name="enable_case_sensitive_identifier").lower() in [
Expand Down
12 changes: 5 additions & 7 deletions awswrangler/redshift/_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from ._connect import _validate_connection
from ._utils import (
_add_new_columns,
_add_new_table_columns,
_create_table,
_does_table_exist,
_get_rsh_columns_types,
Expand Down Expand Up @@ -210,9 +210,8 @@ def to_sql(
varchar_lengths_default=varchar_lengths_default,
varchar_lengths=varchar_lengths,
)
_add_new_columns(
cursor=cursor, schema=schema, table=table, redshift_columns_types=redshift_columns_types
)
_add_new_table_columns(cursor=cursor, schema=schema, table=table,
redshift_columns_types=redshift_columns_types)

created_table, created_schema = _create_table(
df=df,
Expand Down Expand Up @@ -464,9 +463,8 @@ def copy_from_files( # noqa: PLR0913
redshift_column_types=redshift_column_types,
manifest=manifest,
)
_add_new_columns(
cursor=cursor, schema=schema, table=table, redshift_columns_types=redshift_columns_types
)
_add_new_table_columns(cursor=cursor, schema=schema, table=table,
redshift_columns_types=redshift_columns_types)
created_table, created_schema = _create_table(
df=None,
path=path,
Expand Down

0 comments on commit 4027e64

Please sign in to comment.