Skip to content

Commit

Permalink
Apply ruff and black
Browse files Browse the repository at this point in the history
  • Loading branch information
littleK0i committed Aug 16, 2024
1 parent 8cbd1b4 commit fd1f9dc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion snowddl/blueprint/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class PipeBlueprint(SchemaObjectBlueprint):
copy_transform: Optional[Dict[str, str]] = None
copy_file_format: Optional[SchemaObjectIdent] = None
copy_match_by_column_name: Optional[str] = None
copy_include_metadata: Optional[Dict[Ident,Ident]] = None
copy_include_metadata: Optional[Dict[Ident, Ident]] = None
copy_options: Optional[Dict[str, Union[bool, float, int, str, list]]] = None
aws_sns_topic: Optional[str] = None
integration: Optional[Ident] = None
Expand Down
1 change: 0 additions & 1 deletion snowddl/blueprint/ident_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
AccountObjectIdent,
DatabaseIdent,
DatabaseRoleIdent,
Ident,
SchemaIdent,
SchemaObjectIdent,
SchemaObjectIdentWithArgs,
Expand Down
17 changes: 4 additions & 13 deletions snowddl/fernet/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ def build_parser():
)

# Action: config-encrypt
config_encrypt_subparser = subparsers.add_parser(
"config-encrypt",
help="Encrypy all values in config"
)
config_encrypt_subparser = subparsers.add_parser("config-encrypt", help="Encrypy all values in config")

config_encrypt_subparser.add_argument(
"-k",
Expand All @@ -148,10 +145,7 @@ def build_parser():
)

# Action: config-decrypt
config_decrypt_subparser = subparsers.add_parser(
"config-decrypt",
help="Decrypt all values in config"
)
config_decrypt_subparser = subparsers.add_parser("config-decrypt", help="Decrypt all values in config")

config_decrypt_subparser.add_argument(
"-k",
Expand All @@ -168,10 +162,7 @@ def build_parser():
)

# Action: config-rotate
config_rotate_subparser = subparsers.add_parser(
"config-rotate",
help="Rotate all values in config"
)
config_rotate_subparser = subparsers.add_parser("config-rotate", help="Rotate all values in config")

config_rotate_subparser.add_argument(
"-k",
Expand Down Expand Up @@ -233,7 +224,7 @@ def action_config_decrypt(args, wrapper: FernetWrapper):

for file in get_config_files_generator(args):
original_text = file.read_text(encoding="utf-8")
updated_text, number_of_sub = regexp.subn(lambda m: f"!encrypt \"{wrapper.decrypt(m[1])}\"\n", original_text)
updated_text, number_of_sub = regexp.subn(lambda m: f'!encrypt "{wrapper.decrypt(m[1])}"\n', original_text)

if number_of_sub > 0:
file.write_text(updated_text, encoding="utf-8")
Expand Down
2 changes: 1 addition & 1 deletion snowddl/parser/abc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def build_share_role_blueprint(self, share_name):
on=ObjectType.DATABASE,
name=Ident(share_name),
),
]
],
)

def build_warehouse_role_grant(self, warehouse_name, grant_type):
Expand Down
3 changes: 1 addition & 2 deletions snowddl/resolver/abc_role_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
AccountGrant,
FutureGrant,
SchemaIdent,
SchemaObjectIdent,
build_grant_name_ident,
build_future_grant_name_ident,
)
Expand Down Expand Up @@ -79,7 +78,7 @@ def get_existing_role_grants(self, role_name):
else:
try:
grant_name = build_grant_name_ident(object_type, r["name"])
except (KeyError, ValueError) as e:
except (KeyError, ValueError):
self.engine.intention_cache.add_invalid_name_warning(object_type, r["name"])
continue

Expand Down
3 changes: 0 additions & 3 deletions snowddl/resolver/hybrid_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
HybridTableBlueprint,
SchemaObjectIdent,
TableColumn,
PrimaryKeyBlueprint,
UniqueKeyBlueprint,
ForeignKeyBlueprint,
)
from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType

Expand Down

0 comments on commit fd1f9dc

Please sign in to comment.