tekumara / fakesnow

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
Apache License 2.0
83 stars 7 forks source link

parse_json transform is redundant? or its test is missing the point? #64

Closed ifm-pgarner closed 3 months ago

ifm-pgarner commented 3 months ago

I noticed while implementing #63 that the parse_json transform seems to be redundant

For example here: https://github.com/tekumara/fakesnow/blob/main/tests/test_transforms.py#L265-L271

if I remove the .transform(parse_json) from the test it still passes

it seems that sqlglot dialect="duckdb" does the parse_json -> JSON transform itself already

However there are a lot of other test cases in test_transforms.py which use parse_json in their test queries, with other transforms applied instead i.e. relying on sqlglot to do it, so maybe I am missing something - perhaps the parse_json transform is there for a special case that is not being exercised by the corresponding test case?

Possibly related to inconsistency in the docstring example here: https://github.com/tekumara/fakesnow/blob/main/fakesnow/transforms.py#L524-L527 ?

ifm-pgarner commented 3 months ago

aha I've just seen https://github.com/tekumara/fakesnow/pull/62 so this is probably a duplicate of that