Skip to content

Commit

Permalink
#166 - Format using black
Browse files Browse the repository at this point in the history
  • Loading branch information
jirifilip committed Jun 28, 2023
1 parent 1b2bae3 commit 4ce99b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pramen-py/src/pramen_py/metastore/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ def _write_parquet_format_table(
def _write_delta_format_table(
self, df: DataFrame, metastore_table: MetastoreTable
) -> Tuple[str, int]:
info_date_str = convert_date_to_str(self.info_date, fmt=metastore_table.info_date_settings.format)
info_date_str = convert_date_to_str(
self.info_date, fmt=metastore_table.info_date_settings.format
)

df_with_info_date = df.withColumn(
metastore_table.info_date_settings.column, lit(info_date_str).cast(DateType())
metastore_table.info_date_settings.column,
lit(info_date_str).cast(DateType()),
)
df_repartitioned, count_df_items = self._apply_repartitioning(
df_with_info_date, metastore_table.records_per_partition
Expand Down
4 changes: 3 additions & 1 deletion pramen-py/tests/test_metastore/test_writer/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
from pramen_py.models import InfoDateSettings, MetastoreTable, TableFormat


@pytest.mark.parametrize("table_format", (TableFormat.parquet, TableFormat.delta))
@pytest.mark.parametrize(
"table_format", (TableFormat.parquet, TableFormat.delta)
)
def test_write(spark, test_dataframe, tmp_path_builder, table_format):
table_path = tmp_path_builder().as_posix()
metastore_table_config = MetastoreTable(
Expand Down

0 comments on commit 4ce99b6

Please sign in to comment.