Skip to content

Commit

Permalink
Update test_managed_table_dataset.py
Browse files Browse the repository at this point in the history
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
  • Loading branch information
SajidAlamQB committed Jun 5, 2024
1 parent 497ba98 commit 5304aa2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kedro-datasets/tests/databricks/test_managed_table_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def test_save_schema_spark(
assert subset_expected_df.exceptAll(saved_table).count() == 0

def test_save_schema_pandas(
self, subset_pandas_df: pd.DataFrame, subset_expected_df: DataFrame
self, subset_pandas_df: pd.DataFrame, subset_expected_df: DataFrame
):
unity_ds = ManagedTableDataset(
database="test",
Expand Down Expand Up @@ -345,8 +345,8 @@ def test_save_schema_pandas(
table="test_save_pd_schema",
dataframe_type="pandas"
)
saved_table = saved_ds.load().sort_values("name").reset_index(drop=True)
expected_table = subset_expected_df.sort_values("name").reset_index(drop=True)
saved_table = saved_ds.load().toPandas().sort_values("name").reset_index(drop=True)
expected_table = subset_expected_df.toPandas().sort_values("name").reset_index(drop=True)
assert saved_table.equals(expected_table)

def test_save_overwrite(
Expand Down Expand Up @@ -486,7 +486,7 @@ def test_load_pandas(self, sample_pandas_df: pd.DataFrame):
pandas_ds = ManagedTableDataset(
database="test", table="test_load_pandas", dataframe_type="pandas"
)
pandas_df = pandas_ds.load().sort_values("name", ignore_index=True)
pandas_df = pandas_ds.load().toPandas().sort_values("name", ignore_index=True)
expected_df = sample_pandas_df.sort_values("name", ignore_index=True)

assert isinstance(pandas_df, pd.DataFrame) and pandas_df.equals(expected_df)

0 comments on commit 5304aa2

Please sign in to comment.