Skip to content

Commit 5e9d306

Browse files
authored
Merge pull request awslabs#256 from Bit-Quill/fix-la-influxdb3-migration-plugin-line-protocol-naming
Fix client error checking
2 parents cfafab1 + 89018f7 commit 5e9d306

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tools/python/liveanalytics_influxdb3_migration_plugin/liveanalytics_migration_client/liveanalytics_influxdb3_migration_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def __init__(
4242
db_name (str): Timestream for LiveAnalytics database name.
4343
s3_bucket (str): S3 bucket name.
4444
resume_migration (bool): Whether to resume an existing migration, skipping unload operations.
45+
timeout_seconds (int): The number of seconds to wait for each migration request.
46+
region (str): The AWS Region to use.
4547
4648
Returns:
4749
None
@@ -432,7 +434,7 @@ def bulk_invoke_http_trigger(self, metadata):
432434
)
433435
trigger_invocation_response.raise_for_status()
434436
response_body = trigger_invocation_response.json()
435-
if response_body["status"] == "error":
437+
if response_body["status"] != 200 and response_body["status"] != 202:
436438
raise RuntimeError(
437439
f"Migrating {s3_key} failed: {response_body['message']}"
438440
)
@@ -455,8 +457,7 @@ def bulk_invoke_http_trigger(self, metadata):
455457
f"Final verification failed: {final_invocation_response.json()['message']}"
456458
)
457459
except Exception as e:
458-
self.error(f"HTTP invocation failed: {e}")
459-
self.error("View processing engine logs for more information")
460+
self.error(f"HTTP invocation failed: {e}. View processing engine logs for more information")
460461
sys.exit(1)
461462

462463
def get_num_completed_and_total_parquet_files(self):

tools/python/liveanalytics_influxdb3_migration_plugin/liveanalytics_migration_plugin/liveanalytics_migration_plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,9 @@ def transform_row_to_lp(influxdb3_local, row, table_name, column_types):
513513
Transforms data into LineBuilder objects for writing to InfluxDB.
514514
515515
Args:
516-
influxdb3_local (InfluxDB client): Logging and ingestion client
517-
row (string): Row in parquet file
518-
table_name (string): Table name
516+
influxdb3_local (InfluxDB client): Logging and ingestion client.
517+
row (str): Row in parquet file.
518+
table_name (str): Table name.
519519
column_types(dict): Column types and names (only includes types double and int64)
520520
521521
Returns:

0 commit comments

Comments
 (0)