Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Test different hash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiamatrix committed Jan 18, 2024
1 parent e8b61e0 commit 56210f8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
12 changes: 12 additions & 0 deletions prefect_aws/client_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ class AwsClientParameters(BaseModel):
title="Botocore Config",
)

def __hash__(self):
return hash(
(
self.api_version,
self.use_ssl,
self.verify,
self.verify_cert_path,
self.endpoint_url,
self.config,
)
)

@validator("config", pre=True)
def instantiate_config(cls, value: Union[Config, Dict[str, Any]]) -> Dict[str, Any]:
"""
Expand Down
20 changes: 18 additions & 2 deletions prefect_aws/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ class Config:
arbitrary_types_allowed = True

def __hash__(self):
return hash(self.json())
return hash(
(
self.aws_access_key_id,
self.aws_secret_access_key,
self.aws_session_token,
self.profile_name,
self.region_name,
self.aws_client_parameters,
)
)

def get_boto3_session(self) -> boto3.Session:
"""
Expand Down Expand Up @@ -221,7 +230,14 @@ class Config:
arbitrary_types_allowed = True

def __hash__(self):
return hash(self.json())
return hash(
(
self.minio_root_user,
self.minio_root_password,
self.region_name,
self.aws_client_parameters,
)
)

def get_boto3_session(self) -> boto3.Session:
"""
Expand Down

0 comments on commit 56210f8

Please sign in to comment.