Skip to content

Commit

Permalink
Changing string format to fstring
Browse files Browse the repository at this point in the history
  • Loading branch information
treff7es committed Nov 26, 2022
1 parent a3986a8 commit fa1b51a
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,9 @@ def generate_partition_profiler_query(
partition_column_type = c.data_type

if table.time_partitioning.type_ in ("DAY", "MONTH", "YEAR"):
partition_where_clause = "{column_name} BETWEEN {partition_column_type}('{partition_id}') AND {partition_column_type}('{upper_bound_partition_id}')".format(
column_name=table.time_partitioning.field,
partition_id=partition_datetime,
upper_bound_partition_id=upper_bound_partition_datetime,
partition_column_type=partition_column_type,
)
partition_where_clause = f"`{table.time_partitioning.field}` BETWEEN {partition_column_type}('{partition_datetime}') AND {partition_column_type}('{upper_bound_partition_datetime}')"
elif table.time_partitioning.type_ in ("HOUR"):
partition_where_clause = "{column_name} BETWEEN '{partition_id}' AND '{upper_bound_partition_id}'".format(
column_name=table.time_partitioning.field,
partition_id=partition_datetime,
upper_bound_partition_id=upper_bound_partition_datetime,
)
partition_where_clause = f"`{table.time_partitioning.field}` BETWEEN '{partition_datetime}' AND '{upper_bound_partition_datetime}'"
else:
logger.warning(
f"Not supported partition type {table.time_partitioning.type_}"
Expand Down

0 comments on commit fa1b51a

Please sign in to comment.