Skip to content

Commit

Permalink
changing bulkuploadobject operation dict key temporarily to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblack committed Jan 16, 2024
1 parent 70b5963 commit 70c15fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion arcaflow_plugin_opensearch/opensearch_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class BulkUploadOperationMeta:
@dataclass
class BulkUploadObject:
operation: typing.Annotated[
typing.Dict[Operation, BulkUploadOperationMeta],
# typing.Dict[Operation, BulkUploadOperationMeta],
# Temporarily changing the key to a string in order to work
# around a workflow validation failure for the enum as a key
typing.Dict[str, BulkUploadOperationMeta],
schema.name("operation"),
schema.description("The operation type and associated operation metadata."),
]
Expand Down
2 changes: 1 addition & 1 deletion inputs/opensearch_example.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default Docker network IP
url: "http://172.16.0.203:9200"
url: "http://localhost:9200"
# username: "elastic"
# password: "topsecret"
default_index: "myindex"
Expand Down
8 changes: 6 additions & 2 deletions tests/unit/test_arcaflow_plugin_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def test_serialization():
bulk_upload_list=[
BulkUploadObject(
operation={
Operation.INDEX: BulkUploadOperationMeta(
# Operation.INDEX: BulkUploadOperationMeta(
# Temporarily changing the key to a string to work around a problem
"index": BulkUploadOperationMeta(
_index="myotherindex",
_id="abc123",
),
Expand All @@ -34,7 +36,9 @@ def test_serialization():
),
BulkUploadObject(
operation={
Operation.CREATE: BulkUploadOperationMeta(),
# Operation.CREATE: BulkUploadOperationMeta(),
# Temporarily changing the key to a string to work around a problem
"create": BulkUploadOperationMeta(),
},
data={
"key1": "item 2 data value 1",
Expand Down

0 comments on commit 70c15fb

Please sign in to comment.