Skip to content

Commit

Permalink
add test for entity property and non entity property filter
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Feb 14, 2024
1 parent ed55bd9 commit 637d82d
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_trends_data_warehouse(self):
assert set(response.columns).issubset({"date", "total"})
assert response.results[0][1] == [1, 1, 1, 1, 0, 0, 0]

def test_trends_property(self):
def test_trends_entity_property(self):
table_name = self.create_parquet_file()

trends_query = TrendsQuery(
Expand All @@ -170,3 +170,20 @@ def test_trends_property(self):
assert response.columns is not None
assert set(response.columns).issubset({"date", "total"})
assert response.results[0][1] == [1, 0, 0, 0, 0, 0, 0]

def test_trends_property(self):
table_name = self.create_parquet_file()

trends_query = TrendsQuery(
kind="TrendsQuery",
dateRange=DateRange(date_from="2023-01-01"),
series=[DataWarehouseNode(table_name=table_name, id_field="id", timestamp_field="created")],
properties=clean_entity_properties([{"key": "prop_1", "value": "a", "type": "data_warehouse"}]),
)

with freeze_time("2023-01-07"):
response = self.get_response(trends_query=trends_query)

assert response.columns is not None
assert set(response.columns).issubset({"date", "total"})
assert response.results[0][1] == [1, 0, 0, 0, 0, 0, 0]

0 comments on commit 637d82d

Please sign in to comment.