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

tzdata error when loading data on local machine #60

Closed
kvanwerkhoven opened this issue Aug 23, 2023 · 1 comment · Fixed by #64
Closed

tzdata error when loading data on local machine #60

kvanwerkhoven opened this issue Aug 23, 2023 · 1 comment · Fixed by #64
Assignees
Labels
bug Something isn't working

Comments

@kvanwerkhoven
Copy link
Member

Getting an error when trying to load data on my local machine due to missing 'tzdata' file:

File ~\Anaconda3\envs\postsm\lib\site-packages\teehr\loading\nwm22\nwm_point_data.py:100, in process_chunk_of_files(df, location_ids, configuration, variable_name, output_parquet_dir)
     98     filename = f"{min_ref_str}_{max_ref_str}.parquet"
     99 else:
--> 100     min_ref_str = pa.compute.strftime(min_ref, format="%Y%m%dT%HZ")
    101     filename = f"{min_ref_str}.parquet"
    103 pq.write_table(output_table, Path(output_parquet_dir, filename))

File ~\Anaconda3\envs\postsm\lib\site-packages\pyarrow\compute.py:256, in _make_generic_wrapper.<locals>.wrapper(memory_pool, options, *args, **kwargs)
    254 if args and isinstance(args[0], Expression):
    255     return Expression._call(func_name, list(args), options)
--> 256 return func.call(args, options, memory_pool)

File ~\Anaconda3\envs\postsm\lib\site-packages\pyarrow\_compute.pyx:355, in pyarrow._compute.Function.call()

File ~\Anaconda3\envs\postsm\lib\site-packages\pyarrow\error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()

File ~\Anaconda3\envs\postsm\lib\site-packages\pyarrow\error.pxi:100, in pyarrow.lib.check_status()

ArrowInvalid: Cannot locate timezone 'UTC': Timezone database not found at "C:\Users\kvanwerkhoven\Downloads\tzdata"

Seems to be a known issue:
https://stackoverflow.com/questions/76629191/arrowinvalid-cannot-locate-timezone-utc-timezone-database-not-found

But the fix isn't obvious.

@kvanwerkhoven kvanwerkhoven added the bug Something isn't working label Aug 23, 2023
@samlamont
Copy link
Collaborator

I was able to reproduce this in windows in a python environment comparable to teehr-hub, it does not appear to be related to the package version and there are some open issues related to this: apache/arrow#31472

I will change to code to use pandas to calculate the time instead of pyarrow

@samlamont samlamont linked a pull request Aug 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants