Skip to content

Commit

Permalink
fixed pytype
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketsinghrawat committed Jul 23, 2024
1 parent 4e24fa3 commit 223e629
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion weather_mv/loader_pipeline/bq.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from apache_beam.io import WriteToBigQuery, BigQueryDisposition
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.transforms import window
from apache_beam.metrics import metric
from google.cloud import bigquery
from xarray.core.utils import ensure_us_time_resolution

Expand Down Expand Up @@ -294,7 +295,7 @@ def to_rows(self, coordinates: t.Iterable[t.Dict], ds: xr.Dataset, uri: str) ->
# 'row' ends up looking like:
# {'latitude': 88.0, 'longitude': 2.0, 'time': '2015-01-01 06:00:00', 'd': -2.0187, 'cc': 0.007812,
# 'z': 50049.8, 'data_import_time': '2020-12-05 00:12:02.424573 UTC', ...}
beam.metrics.Metrics.counter('Success', 'ExtractRows').inc()
metric.Metrics.counter('Success', 'ExtractRows').inc()
yield row

def chunks_to_rows(self, _, ds: xr.Dataset) -> t.Iterator[t.Dict]:
Expand Down
3 changes: 2 additions & 1 deletion weather_mv/loader_pipeline/ee.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import ee
import numpy as np
from apache_beam.io.filesystems import FileSystems
from apache_beam.metrics import metric
from apache_beam.io.gcp.gcsio import WRITE_CHUNK_SIZE
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.utils import retry
Expand Down Expand Up @@ -765,6 +766,6 @@ def start_ingestion(self, asset_data: AssetData) -> t.Optional[str]:
def process(self, asset_data: AssetData) -> t.Iterator[str]:
"""Uploads an asset into the earth engine."""
asset_id = self.start_ingestion(asset_data)
beam.metrics.Metrics.counter('Success', 'IngestIntoEE').inc()
metric.Metrics.counter('Success', 'IngestIntoEE').inc()

yield asset_id

0 comments on commit 223e629

Please sign in to comment.