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

weather-mv: Implemented streaming import of data into BigQuery. #58

Merged
merged 13 commits into from
Jan 7, 2022

Conversation

alxmrs
Copy link
Collaborator

@alxmrs alxmrs commented Dec 31, 2021

Fixes #51.

TODO:

  • Manually test the pipeline end-to-end
  • (reach) add PubSub integration tests
  • Update weather-mv's documentation to reflect the new functionality.

@alxmrs
Copy link
Collaborator Author

alxmrs commented Jan 6, 2022

Pre-requisite: #62.

@alxmrs alxmrs marked this pull request as ready for review January 6, 2022 23:58
@alxmrs alxmrs requested a review from pramodg January 6, 2022 23:58
@@ -207,9 +215,10 @@ def get_coordinates(ds: xr.Dataset) -> t.Iterator[t.Dict]:
# Example:
# {'longitude': -108.0, 'latitude': 49.0, 'time': '2018-01-02T23:00:00+00:00'}
idx = 0
total_coords = _prod(ds.coords.dims.values())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor note: dims may not give you the right set,
IIRC indexes was a subset of dims (check one of the grib test files.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the dims of the coords the correct subset? I just ran a small experiment:

>>> ds = xr.open_dataset(gb, engine='cfgrib')  # gb is a path to test_data_grib_single_timestamp
>>> [len(x) for x in ds.coords.indexes.values()]
[1801, 3600]
>>> ds.coords.dims.values()
ValuesView(Frozen({'latitude': 1801, 'longitude': 3600}))

@alxmrs alxmrs merged commit 7faf96c into main Jan 7, 2022
@alxmrs alxmrs deleted the mv-streaming branch January 7, 2022 01:27
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

Successfully merging this pull request may close these issues.

weather-mv: Support streaming conversions to BigQuery.
2 participants