Blake
08/08/2024, 10:20 PMAwsCredentials(region_name=None, profile_name=None, aws_access_key_id=None, aws_session_token=None, **aws_client_parameters={'config': None, 'verify': True, 'use_ssl': True, 'api_version': None, 'endpoint_url': None, 'verify_cert_path': None}**, aws_secret_access_key=None)
Which leads to TypeError: unhashable type: 'dict'
whenever I try to work with the S3 bucketBlake
08/08/2024, 10:20 PMMarvin
08/08/2024, 10:20 PMAwsCredentials
and aws_client_parameters
are being handled within the Prefect framework, specifically leading to a TypeError: unhashable type: 'dict'
.
### Key Points:
1. AWSCredentials Block:
- The AwsCredentials
class can be used within an S3Bucket
block to provide authentication when interacting with an S3 bucket.
- Example usage:
my_s3_bucket = S3Bucket(
bucket_name="my_s3_bucket",
credentials=AWSCredentials.load("my_aws_credentials")
)
2. Reported Issue:
- The error TypeError: unhashable type: 'dict'
occurs due to the way aws_client_parameters
are stored.
- This is often due to incorrect storage or handling of the parameters, especially when assigned through the UI.
3. Possible Solution:
- Ensure that aws_client_parameters
is properly initialized and not directly passed as a dictionary.
- Use the helper methods to initialize AwsCredentials
properly.
### GitHub Issues:
- Issue #14147: Discusses the TypeError
with similar configurations.
- Issue #13349: Highlights how aws_client_parameters
being stored as a dictionary leads to errors.
References:
- For more details on configuring and using AwsCredentials
, you can refer to the Prefect documentation on Blocks and AWS integrations.
- GitHub Issue: AWS Client Parameters Issue
Try ensuring the AwsCredentials
are properly instantiated according to the documentation, possibly avoiding direct dictionary assignment in the parameters. If the error persists, consult the open issues for updates or consider opening a new issue if your scenario slightly differs.Nate
08/08/2024, 11:08 PMNate
08/08/2024, 11:08 PMNate
08/08/2024, 11:09 PMBlake
08/09/2024, 3:16 PMBlake
08/09/2024, 3:16 PMFile ".venv/lib/python3.11/site-packages/prefect_aws/credentials.py", line 143, in get_boto3_session
aws_secret_access_key = self.aws_secret_access_key.get_secret_value()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get_secret_value'
Blake
08/09/2024, 3:17 PMNate
08/09/2024, 3:26 PMBlake
08/09/2024, 6:35 PMNate
08/09/2024, 6:37 PM