<@ULVA73B9P> I have an optional command-line argum...
# ask-marvin
a
@Marvin I have an optional command-line argument (currently set to null right now) and the validate parameters option is unchecked, but I'm still getting ParameterTypeError
m
I couldn't find specific documentation or issues that directly address the
ParameterTypeError
for optional command-line arguments with validation unchecked. However, here are some general recommendations that might help: 1. Ensure Proper Default Value: If the argument is optional and can be
None
, explicitly set its default value to
None
. For example:
Copy code
python
    def my_function(arg: Optional[str] = None):
        pass
2. Check Parameter Definitions: Verify that all parameters in your flow or deployment match the expected types and default values. Even though validation is unchecked, mismatched parameter types might still raise errors. 3. Custom Parameters in Deployment: Ensure that you are providing custom values correctly while creating ad-hoc flow runs. Details on this process can be found at: https://docs.prefect.io/latest/concepts/deployments-block-based/ If you continue to face issues, providing more specific code snippets or error logs could help in diagnosing the problem further. For additional details, you can refer to the Prefect deployment documentation: - https://docs.prefect.io/latest/concepts/deployments-block-based/ I hope one of these suggestions resolves your issue. If not, feel free to provide more details!
a
If the argument is not given, my code will generate a default value to pass to my flow. This default value is generated outside the flow block