Skip to content

Instantly share code, notes, and snippets.

@zdravko-il
Last active March 28, 2023 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdravko-il/31a37ba4b0ed18292f25074103ace65b to your computer and use it in GitHub Desktop.
Save zdravko-il/31a37ba4b0ed18292f25074103ace65b to your computer and use it in GitHub Desktop.
def test_filter(session: Session):
source_data = [...]
schema = T.StructType(...)
source_df = session.create_dataframe(source_data, schema=schema)
actual_df = process.filter_personal_consumption_expenditures(source_df)
expected_data = [(2021, 115.53)]
expected_df = session.create_dataframe(
expected_data,
schema=T.StructType(
[
T.StructField("Year", T.IntegerType(), nullable=True),
T.StructField("PCE", T.DoubleType(), nullable=True),
]
),
)
assert actual_df.collect() == expected_df.collect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment