-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Python Add the Amazon Neptune Python follow #7473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you've made the high-level fixes and it matches the specification, I can do a full review.
@@ -18,6 +26,14 @@ neptune_Hello: | |||
neptune: {DescribeDBClustersPaginator} | |||
neptune_ExecuteQuery: | |||
languages: | |||
Python: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metadata tag is not listed in the specification.
@@ -31,6 +47,14 @@ neptune_ExecuteQuery: | |||
neptune: {ExecuteQuery} | |||
neptune_CreateGraph: | |||
languages: | |||
Python: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metadata key not listed in specification.
@@ -44,6 +68,14 @@ neptune_CreateGraph: | |||
neptune: {CreateGraph} | |||
neptune_ExecuteOpenCypherExplainQuery: | |||
languages: | |||
Python: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key not listed in specification. Same for many of these in this file.
@@ -0,0 +1,31 @@ | |||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python files should not be named with uppercase names. They should match the patterns in the rest of the library. Same for all files in this PR.
response = neptune_client.describe_db_clusters() | ||
for cluster in response.get("DBClusters", []): | ||
print(f"Cluster Identifier: {cluster['DBClusterIdentifier']}") | ||
print(f"Status: {cluster['Status']}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specification requires handling a ResourceNotFoundException.
""" | ||
Main entry point: creates the Neptune client and calls the describe operation. | ||
""" | ||
neptune_client = boto3.client("neptune", region_name="us-east-1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not hard-code regions.
neptune_client.delete_db_cluster(**request) | ||
print(f" Deleting DB Cluster: {cluster_id}") | ||
except Exception as e: | ||
print(f" Failed to delete DB Cluster '{cluster_id}': {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specification requires handling a ResourceNotFoundException. Same for all actions in this PR, they should follow the specification.
hours, mins = divmod(mins, 60) | ||
return f"{hours:02}:{mins:02}:{secs:02}" | ||
|
||
def wait_until_instance_deleted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is not needed, it should use the built-in boto3 waiters.
@pytest.mark.integration | ||
def test_neptune_run_scenario(monkeypatch): | ||
# Patch input() to simulate all required inputs | ||
input_sequence = iter([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need to press c to move on in python.
@pytest.fixture(scope="module") | ||
def neptune_client(): | ||
"""Create a real Neptune boto3 client for integration testing.""" | ||
client = boto3.client("neptune", region_name="us-east-1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow the current testing patterns in the library until we decide as a team to change it.
This pull request adds the Amazon Neptune Python follow
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.