Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekOzana committed Dec 10, 2024
1 parent 53bdca9 commit 1f78712
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/data/results_with_NaN_DOUBLE.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"rank": 0,
"values": [
"NaN",
0.0002732545901463368,
-0.0008638730296779248
0.000273,
-0.000863
]
},
"secondaryColumns": [
Expand Down
14 changes: 13 additions & 1 deletion tests/test_plbbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,19 @@ def test_parse_bql_responses():
"#eps.CURRENCY": "STRING",
},
),
(
"tests/data/results_with_NaN_DOUBLE.json",
{
"ID": ["YX231113 Corp", "YX231113 Corp", "YX231113 Corp"],
"#rets": ["NaN", 0.000273, -0.000863],
"#rets.DATE": [
"2024-12-07T00:00:00Z",
"2024-12-08T00:00:00Z",
"2024-12-09T00:00:00Z",
],
},
{"ID": "STRING", "#rets": "DOUBLE", "#rets.DATE": "DATE"},
),
],
)
def test_parse_bql_response_dict(json_file, expected_data, expected_schema):
Expand All @@ -492,7 +505,6 @@ def test_parse_bql_response_dict(json_file, expected_data, expected_schema):

# Call the method to test
cols, schema = bq._parse_bql_response_dict(results)

# Assert that the data matches the expected output
assert cols == expected_data
# Assert that the column types match the expected schema
Expand Down

0 comments on commit 1f78712

Please sign in to comment.