Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlalchemy engine seems to caching metadata causing inconsistency #18

Open
lixiliu opened this issue Nov 13, 2024 · 0 comments
Open

sqlalchemy engine seems to caching metadata causing inconsistency #18

lixiliu opened this issue Nov 13, 2024 · 0 comments

Comments

@lixiliu
Copy link
Collaborator

lixiliu commented Nov 13, 2024

Running the following in test_timeseries_mapper.py will raise an error due to inconsistency between the ingested table and the Metadata() object.

def test__one_week_per_month_by_hour(iter_engines: Engine):
    run_test(iter_engines, one_week=True, tzinfo=None) # this has no time_zone
    run_test(iter_engines, one_week=True, tzinfo=ZoneInfo("US/Eastern")) # this expects time_zone

The metadata object seems to be retaining remnant of the first run_test, which does not have a time_zone column, whereas the second test does.

Confirmed by running the pytest as a regular function that it is not a pytest issue.

The current workaround is to parametrize the pytest on tzinfo or keep each run_test as separate function so that the engine is created new each time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant