Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
[ci] remove unnecessary f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored and skrawcz committed Aug 29, 2022
1 parent 951a4ca commit def6c92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions hamilton/data_quality/default_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def arg(cls) -> str:
@staticmethod
def _validate_max_fraction_nans(max_fraction_nans: float):
if not (0 <= max_fraction_nans <= 1):
raise ValueError(f"Maximum fraction allowed to be nan must be in range [0,1]")
raise ValueError("Maximum fraction allowed to be nan must be in range [0,1]")


class AllowNaNsValidatorPandasSeries(MaxFractionNansValidatorPandasSeries):
Expand Down Expand Up @@ -415,7 +415,7 @@ def _append_pandera_to_default_validators():
import pandera
except ModuleNotFoundError:
logger.info(
f"Cannot import pandera from pandera_validators. Run pip install sf-hamilton[pandera] if needed."
"Cannot import pandera from pandera_validators. Run pip install sf-hamilton[pandera] if needed."
)
return
from hamilton.data_quality import pandera_validators
Expand Down
2 changes: 1 addition & 1 deletion hamilton/data_quality/pandera_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def applies_to(cls, datatype: Type[Type]) -> bool:
) # TODO -- allow for modin, etc. as they come for free with pandera

def description(self) -> str:
return f"Validates that the returned dataframe matches the pander"
return "Validates that the returned dataframe matches the pander"

def validate(self, data: pd.DataFrame) -> base.ValidationResult:
try:
Expand Down
4 changes: 2 additions & 2 deletions hamilton/dev_utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _do_deprecation_action(self, fn: Callable):
+ (
[f"For migration, see: {self.migration_guide}."]
if self.migration_guide is not None
else [f"This is a drop-in replacement."]
else ["This is a drop-in replacement."]
)
)
self.fail_action(failure_message)
Expand All @@ -140,7 +140,7 @@ def _do_deprecation_action(self, fn: Callable):
+ (
[f"For migration, see: {self.migration_guide}."]
if self.migration_guide is not None
else [f"This is a drop-in replacement."]
else ["This is a drop-in replacement."]
)
)
self.warn_action(warn_message)
Expand Down
8 changes: 4 additions & 4 deletions hamilton/experimental/h_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ async def raw_execute(
self.graph.execute(nodes, memoized_computation, overrides, inputs)
if display_graph:
raise ValueError(
f"display_graph=True is not supported for the async graph adapter. "
f"Instead you should be using visualize_execution."
"display_graph=True is not supported for the async graph adapter. "
"Instead you should be using visualize_execution."
)
task_dict = {
key: asyncio.create_task(process_value(memoized_computation[key])) for key in final_vars
Expand All @@ -138,8 +138,8 @@ async def execute(
"""
if display_graph:
raise ValueError(
f"display_graph=True is not supported for the async graph adapter. "
f"Instead you should be using visualize_execution."
"display_graph=True is not supported for the async graph adapter. "
"Instead you should be using visualize_execution."
)
try:
outputs = await self.raw_execute(final_vars, overrides, display_graph, inputs=inputs)
Expand Down
8 changes: 4 additions & 4 deletions hamilton/function_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __init__(self, **parameterization: Dict[str, Dict[str, str]]):
"""
self.parametrization = parameterization
if not parameterization:
raise ValueError(f"Cannot pass empty/None dictionary to parameterize_sources")
raise ValueError("Cannot pass empty/None dictionary to parameterize_sources")
for output, mappings in parameterization.items():
if not mappings:
raise ValueError(
Expand Down Expand Up @@ -1116,12 +1116,12 @@ def _validate_constructor_args(
if len(validator) != 0:
if importance is not None or len(default_validator_kwargs) > 0:
raise ValueError(
f"Can provide *either* a list of custom validators or arguments for the default validator. "
f"Instead received both."
"Can provide *either* a list of custom validators or arguments for the default validator. "
"Instead received both."
)
else:
if importance is None:
raise ValueError(f"Must supply an importance level if using the default validator.")
raise ValueError("Must supply an importance level if using the default validator.")

def validate(self, fn: Callable):
"""Validates that the check_output node works on the function on which it was called
Expand Down

0 comments on commit def6c92

Please sign in to comment.