Skip to content

Commit

Permalink
getting compliant with E501 (line length)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpmcginty committed Jan 13, 2025
1 parent 5eb6e61 commit 37c7242
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ src = ["src", "test"]

[tool.ruff.lint]
select = ["E", "F", "W", "C90"]
ignore = ["E501"]
# ignore = ["E501"]

# -----------------------------------------------------------------------------
## bumpversion Configurations
Expand Down
3 changes: 2 additions & 1 deletion src/aibs_informatics_core/executors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def run_executor(
Args:
input (JSON): input to executor
output_location (Optional[str], optional): Optional output location to write response to. Defaults to None.
output_location (Optional[str], optional): Optional output location to write
response to. Defaults to None.
"""
executor = cls.build_from_env(**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion src/aibs_informatics_core/models/aws/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConditionBaseExpression(SchemaModel):

class ConditionBaseExpressionString(ValidatedStr):
regex_pattern: ClassVar[Pattern] = re.compile(
r"([\w\.]+)(?:( begins_with | contains | NOT | IN |=|<>|<|<=|>|>=)(.+)|( attribute_exists))"
r"([\w\.]+)(?:( begins_with | contains | NOT | IN |=|<>|<|<=|>|>=)(.+)|( attribute_exists))" # noqa: E501
)

@property
Expand Down
6 changes: 0 additions & 6 deletions src/aibs_informatics_core/models/aws/efs.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ class EFSPath(ValidatedStr):
"""

regex_pattern: ClassVar[re.Pattern] = re.compile(
# rf"""
# (?:efs:\/\/(?!.*:\/)|(?:(?:efs:\/\/)?(?=.*:\/)))
# (?:({FILE_SYSTEM_ID_PATTERN})\.efs\.{AWS_REGION_PATTERN}\.amazonaws\.com|({FILE_SYSTEM_ID_PATTERN}))
# :?
# ({PATH_PATTERN})
# """
rf"""
(?:
(?:efs://)(?:({FILE_SYSTEM_ID_PATTERN})\.efs\.{AWS_REGION_PATTERN}\.amazonaws\.com|({FILE_SYSTEM_ID_PATTERN})):?
Expand Down
5 changes: 3 additions & 2 deletions src/aibs_informatics_core/models/db/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def get_key_filter(
Args:
partition_value (DynamoDBItemValue): Partition key value
sort_value (Optional[DynamoDBItemValue], optional): Optional sort key value. Defaults to None.
sort_value (Optional[DynamoDBItemValue], optional): Optional sort key value.
Defaults to None.
Returns:
DynamoDBKey: A DynamoDBKey mapping that maps partition and sort key names to values
Expand Down Expand Up @@ -198,7 +199,7 @@ def get_primary_key(
Returns:
DynamoDBKey: A DynamoDBKey mapping that maps partition and sort key names to values
"""
""" # noqa: E501
if self.key_name is None:
raise ValueError(f"'{self}' has no key name.")
db_key = {self.key_name: partition_value}
Expand Down
14 changes: 8 additions & 6 deletions src/aibs_informatics_core/models/demand_execution/param_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def from_sets(cls, inputs: Iterable[str], outputs: Iterable[str]) -> List[ParamP
class ParamSetPair(SchemaModel):
"""SchemaModel for a set of input and output parameter pairs as described in demand execution
The values for inputs and outputs should correspond to the parameter keys in the demand execution
The values for inputs and outputs should correspond to the parameter keys in the
demand execution.
Scenarios:
1. inputs and outputs are not empty
Expand Down Expand Up @@ -120,8 +121,9 @@ def from_pairs(cls, *pairs: ParamPair) -> List[ParamSetPair]:
class JobParamPair:
"""models an input and output resolved parameter pair as described in demand execution
The values for input and outputs should account for both the parameter name and the remote location
of the parameter value. The remote location can be a S3URI or other remote location.
The values for input and outputs should account for both the parameter name and the
remote location of the parameter value. The remote location can be a S3URI or other
remote location.
This captures all information about a parameter
Expand All @@ -134,7 +136,7 @@ class JobParamPair:
This is used to represent a single job that has only outputs
4. input is not None and output is None (input only)
This is used to represent a single job that has only inputs
"""
""" # noqa: E501

input: Optional[ResolvableJobParam] = None
output: Optional[ResolvableJobParam] = None
Expand Down Expand Up @@ -174,7 +176,7 @@ class JobParamSetPair:
This is used to represent a single job that has only outputs
4. inputs is not empty and outputs is empty
This is used to represent a single job that has only inputs
"""
""" # noqa: E501

inputs: FrozenSet[ResolvableJobParam] = field(default_factory=frozenset)
outputs: FrozenSet[ResolvableJobParam] = field(default_factory=frozenset)
Expand Down Expand Up @@ -236,7 +238,7 @@ class ResolvedParamSetPair(SchemaModel):
This only captures the remote location of a parameter. It does not capture the parameter name.
"""
""" # noqa: E501

inputs: FrozenSet[ResolvableID] = custom_field(
mm_field=FrozenSetField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _param_to_job_params__build_output(self, k: str, v: Any) -> JobParam:
remote_value = str_uploadable.remote or S3URI(f"{self.output_s3_prefix}/{v}")
return UploadableJobParam(k, str_uploadable.local, remote_value)
else:
# Only create default remote if value is string and not a stringified uploadable reference
# Only create default remote if value is str and not a stringified uploadable reference
default_remote = (
S3URI(f"{self.output_s3_prefix}/{v}")
if isinstance(v, str) and self.output_s3_prefix
Expand Down
2 changes: 1 addition & 1 deletion src/aibs_informatics_core/utils/file_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class PathLock:
lock file will be created in this directory with the name of the hash of the path.
Otherwise, a lock file with the same name as the path and a .lock extension
will be created. Defaults to None.
"""
""" # noqa: E501

path: Union[str, Path]
lock_root: Optional[Union[str, Path]] = None
Expand Down
7 changes: 4 additions & 3 deletions test/aibs_informatics_core/models/api/test_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test__get_response_cls__returns_correct_class():
method="GET",
url=f"{DEFAULT_BASE_URL}/test/resource",
params={
"data": "eyJhbnlfbGlzdCI6IFsiYSIsIDFdLCAiYW55X21hcCI6IHsiMSI6IDEsICJzdHJrZXkiOiAic3RydmFsdWUifSwgImlkX3N0ciI6ICJpbWFuaWQifQ=="
"data": "eyJhbnlfbGlzdCI6IFsiYSIsIDFdLCAiYW55X21hcCI6IHsiMSI6IDEsICJzdHJrZXkiOiAic3RydmFsdWUifSwgImlkX3N0ciI6ICJpbWFuaWQifQ==" # noqa: E501
},
),
id="GET Route with list and dict fields converted",
Expand All @@ -180,7 +180,7 @@ def test__get_response_cls__returns_correct_class():
method="GET",
url=f"{DEFAULT_BASE_URL}/test/imanid/resource",
params={
"data": "eyJhbnlfbGlzdCI6IFsiYSIsIDFdLCAiYW55X21hcCI6IHsiMSI6IDEsICJzdHJrZXkiOiAic3RydmFsdWUifX0="
"data": "eyJhbnlfbGlzdCI6IFsiYSIsIDFdLCAiYW55X21hcCI6IHsiMSI6IDEsICJzdHJrZXkiOiAic3RydmFsdWUifX0=" # noqa: E501
},
),
id="(Dynamic) GET Route with list and dict fields converted",
Expand Down Expand Up @@ -291,7 +291,8 @@ class TestApiRequestConfig(ApiRequestConfig):
# client_version_default takes precedence over client_version_package_name_default
self.assertEqual(TestApiRequestConfig.build__client_version(), VersionStr("1.2.3"))

# client_version_package takes precedence over client_version_default when set in env vars / kwargs
# client_version_package takes precedence over client_version_default when
# set in env vars / kwargs
self.assertEqual(
TestApiRequestConfig.build__client_version(client_version_package_name=PACKAGE_B),
VersionStr("2.2.2"),
Expand Down
2 changes: 1 addition & 1 deletion test/aibs_informatics_core/models/aws/test_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test__UserId__validates(


@mark.parametrize(
"value, expected_account_id, expected_resource, expected_resource_type, expected_resource_id, expected_resource_name, expected_resource_path, raise_expectation",
"value, expected_account_id, expected_resource, expected_resource_type, expected_resource_id, expected_resource_name, expected_resource_path, raise_expectation", # noqa: E501
[
param(
"arn:aws:iam::123456789012:root",
Expand Down
2 changes: 1 addition & 1 deletion test/aibs_informatics_core/models/aws/test_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test__LambdaFunctionName__validation(


@mark.parametrize(
"value, expected_url_id, expected_region, expected_url, expected_path, expected_query, raise_expectation",
"value, expected_url_id, expected_region, expected_url, expected_path, expected_query, raise_expectation", # noqa: E501
[
param(
"https://abcd1234.lambda-url.us-west-2.on.aws/",
Expand Down
2 changes: 1 addition & 1 deletion test/aibs_informatics_core/models/aws/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test__S3PathStats__getitem__works():
"key": "${Token[detail-requestParameters-key.2806]}",
},
does_not_raise(),
id="URI with env_var interpolation and periods/dashes succeeds with full_validate=False",
id="URI with env_var interpolation and periods/dashes succeeds with full_validate=False", # noqa: E501
),
pytest.param(
# test_input
Expand Down

0 comments on commit 37c7242

Please sign in to comment.