You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run generate_params with a params file that contains a parameter that is not a string, you will get an error like 'int' object has no attribute 'startswith'.
Expected Behavior
It should instead provide an error message saying certain parameter in certain file should be a string.
Current Behavior
Here's how the error currently looks(from a quick modification of current unit tests):
tests/test_generate_params.py:211 (test_merge_params)
cls = <generate_params.Parameters object at 0x10aca6710>
def test_merge_params(cls):
shutil.copy(
f"{cls.cwd}/stub_cfn_global_invalid.json",
f"{cls.cwd}/params/global.json",
)
with patch.object(
ParameterStore,
'fetch_parameter',
return_value='something'
):
parse = cls._parse(
cls.cwd,
'global',
)
> compare = cls._merge_params(
parse,
{'Parameters': {}, 'Tags': {}}
)
test_generate_params.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../generate_params.py:446: in _merge_params
self.resolver.apply_intrinsic_function_if_any(
../resolver.py:59: in apply_intrinsic_function_if_any
matching_resolver = self._matching_intrinsic_resolver(lookup_value)
../resolver.py:32: in _matching_intrinsic_resolver
matches = list(filter(
../resolver.py:33: in <lambda>
lambda resolver: resolver.supports(lookup_str),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <resolver_param_store.ResolverParamStore object at 0x10bcf7e50>
lookup_str = 1
def supports(self, lookup_str: str) -> bool:
"""
Check if this resolver supports the lookup_str syntax.
Args:
lookup_str (str): The lookup string that might have resolve: or
another resolver syntax.
Returns:
bool: True if this resolver supports the lookup_str syntax.
In other words, the lookup_str starts with `resolve:`.
False if not.
"""
> return lookup_str.startswith('resolve:')
E AttributeError: 'int' object has no attribute 'startswith'
../resolver_param_store.py:89: AttributeError
Steps To Reproduce
Run generate_params script with a params file that contains a parameter value that is not a string:
global.yml:
Parameters:
Budget: 100
Possible Solution
We should run something similar to schema_validation for the parameter files before processing them. I'm happy to contribute to this, if the other contributers see no issues with or if there's a particular way that it should be done.
Is there an existing issue for this?
Describe the bug
If you run generate_params with a params file that contains a parameter that is not a string, you will get an error like
'int' object has no attribute 'startswith'
.Expected Behavior
It should instead provide an error message saying certain parameter in certain file should be a string.
Current Behavior
Here's how the error currently looks(from a quick modification of current unit tests):
Steps To Reproduce
global.yml:
Possible Solution
We should run something similar to schema_validation for the parameter files before processing them. I'm happy to contribute to this, if the other contributers see no issues with or if there's a particular way that it should be done.
Additional Information/Context
No response
ADF Version
Latest master(ef662ec)
Contributing a fix?
The text was updated successfully, but these errors were encountered: