Skip to content

Commit

Permalink
Fixed QA checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavatlan committed Jan 6, 2025
1 parent 7ad950c commit d7bed9a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
34 changes: 29 additions & 5 deletions pyatlan/model/assets/s3_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ def creator(
"s3_bucket_name",
"s3_bucket_qualified_name",
],
[name, connection_qualified_name, aws_arn,s3_bucket_name,s3_bucket_qualified_name],
[
name,
connection_qualified_name,
aws_arn,
s3_bucket_name,
s3_bucket_qualified_name,
],
)
attributes = S3Object.Attributes.create(
name=name,
Expand Down Expand Up @@ -101,7 +107,13 @@ def create_with_prefix(
"s3_bucket_name",
"s3_bucket_qualified_name",
],
[name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name],
[
name,
connection_qualified_name,
prefix,
s3_bucket_name,
s3_bucket_qualified_name,
],
)
attributes = S3Object.Attributes.create_with_prefix(
name=name,
Expand Down Expand Up @@ -351,7 +363,13 @@ def create(
"s3_bucket_name",
"s3_bucket_qualified_name",
],
[name, connection_qualified_name, aws_arn, s3_bucket_name, s3_bucket_qualified_name],
[
name,
connection_qualified_name,
aws_arn,
s3_bucket_name,
s3_bucket_qualified_name,
],
)
fields = connection_qualified_name.split("/")
if len(fields) != 3:
Expand All @@ -370,7 +388,7 @@ def create(
connection_qualified_name=connection_qualified_name,
qualified_name=f"{connection_qualified_name}/{aws_arn}",
connector_name=connector_type.value,
s3_bucket_name= s3_bucket_name,
s3_bucket_name=s3_bucket_name,
s3_bucket_qualified_name=s3_bucket_qualified_name,
bucket=S3Bucket.ref_by_qualified_name(s3_bucket_qualified_name),
)
Expand All @@ -394,7 +412,13 @@ def create_with_prefix(
"s3_bucket_name",
"s3_bucket_qualified_name",
],
[name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name],
[
name,
connection_qualified_name,
prefix,
s3_bucket_name,
s3_bucket_qualified_name,
],
)
fields = connection_qualified_name.split("/")
if len(fields) != 3:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/s3_asset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _assert_object(s3object, bucket, with_name=False):
assert s3object.qualified_name
assert s3object.name == OBJECT_NAME
assert s3object.connector_name == AtlanConnectorType.S3.value
assert s3object.s3_bucket_name == bucket.name
assert s3object.s3_bucket_name == bucket.name
assert s3object.s3_bucket_qualified_name == bucket.qualified_name
if with_name:
assert s3object.aws_arn is None
Expand Down
14 changes: 12 additions & 2 deletions tests/unit/model/s3object_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@
],
)
def test_create_without_required_parameters_raises_validation_error(
name, connection_qualified_name, aws_arn, s3_bucket_name, s3_bucket_qualified_name, msg
name,
connection_qualified_name,
aws_arn,
s3_bucket_name,
s3_bucket_qualified_name,
msg,
):
with pytest.raises(ValueError, match=msg):
S3Object.create(
Expand Down Expand Up @@ -276,7 +281,12 @@ def test_create_without_required_parameters_raises_validation_error(
],
)
def test_create_with_prefix_without_required_parameters_raises_validation_error(
name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name, msg
name,
connection_qualified_name,
prefix,
s3_bucket_name,
s3_bucket_qualified_name,
msg,
):
with pytest.raises(ValueError, match=msg):
S3Object.create_with_prefix(
Expand Down

0 comments on commit d7bed9a

Please sign in to comment.