Created
April 24, 2022 08:30
-
-
Save h3xagn/dbb816178258226108858951444dda83 to your computer and use it in GitHub Desktop.
Build ETL from device to cloud: https://h3xagn.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # upload data to azure | |
| has_json_uploaded, has_csvgz_uploaded = upload_data_to_azure(json_filename, json_data, transformed_filename, transformed_data) | |
| if not has_json_uploaded: | |
| # generate json path for failed uploads | |
| json_file_path_failed = f"{base_dir}\\data\\failed_upload\\raw\\{json_filename}" | |
| with open(json_file_path_failed, "w") as jsonfile: | |
| json.dump(json_data, jsonfile) | |
| if not has_csvgz_uploaded: | |
| # generate csv path for failed uploads | |
| csv_file_path_failed = f"{base_dir}\\data\\failed_upload\\processed\\{transformed_filename}" | |
| transform_data.to_csv( | |
| csv_file_path_failed, | |
| compression="gzip", | |
| index=False, | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment