Skip to content

Commit

Permalink
Update stac_to_cloud.py
Browse files Browse the repository at this point in the history
Update again when py_stac.validate_all() works properly
  • Loading branch information
EtienneKras committed Jul 26, 2023
1 parent f95a3b3 commit aa96b89
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions scripts/stac_to_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@
os.path.join(source_dir_fp, "catalog.json") # local cloned STAC
)

if catalog.validate_all() == None: # no valid STAC
print(
"STAC is not valid and hence not uploaded to cloud, please adjust"
" accordingly"
)
else:
dir_to_google_cloud(
dir_path=source_dir_fp,
gcs_project=GCS_PROJECT,
bucket_name=BUCKET_NAME,
bucket_proj=BUCKET_PROJ,
dir_name=STAC_NAME,
)
# TODO: fix STAC validation to work properly with pystac >1.8
# if catalog.validate_all() == None: # no valid STAC
# print(
# "STAC is not valid and hence not uploaded to cloud, please adjust"
# " accordingly"
# )
# else:
dir_to_google_cloud(
dir_path=source_dir_fp,
gcs_project=GCS_PROJECT,
bucket_name=BUCKET_NAME,
bucket_proj=BUCKET_PROJ,
dir_name=STAC_NAME,
)

0 comments on commit aa96b89

Please sign in to comment.