Tomás Emilio Silva Ebensperger

    Tomás Emilio Silva Ebensperger

    1 week ago
    When I set up parameters for a Deployment in the UI, I specify one of the parameters as type dict, for some reason the UI is saying it is an object and it treats it as a json instead. I can always load the json into a dict in the code, but I was wondering if I am doing something wrong.
    Michael Adkins

    Michael Adkins

    1 week ago
    We should automatically be coercing the JSON to a dictionary at runtime for you, is this not happening?
    Tomás Emilio Silva Ebensperger

    Tomás Emilio Silva Ebensperger

    1 week ago
    no
    Michael Adkins

    Michael Adkins

    1 week ago
    Could you share a short example that prints the value of the parameter at runtime and includes the value you’ve set via the UI? We’ve got some WIP for improving the UI import forms here as well.
    You can also check the schema that will get generated for your flow function:
    from prefect.utilities.callables import parameter_schema
    
    parameter_schema(my_flow)
    Tomás Emilio Silva Ebensperger

    Tomás Emilio Silva Ebensperger

    1 week ago
    @flow
    def run(
    	sf_session_id: str=None,
    	db_config: dict=None,
    	sobjects: str or list=None,
    	method_: str='run',
    	run_local: bool=False,
    	# *args, 
    	# **kwargs,
    ):
    title='Parameters' type='object' properties={'sf_session_id': {'title': 'sf_session_id', 'type': 'string'}, 'db_config': {'title': 'db_config', 'type': '
    object'}, 'sobjects': {'title': 'sobjects', 'type': 'string'}, 'method_': {'title': 'method_', 'default': 'run', 'type': 'string'}, 'run_local': {'title'
    : 'run_local', 'default': False, 'type': 'boolean'}} required=None definitions=None
    it says is is an object
    which "jsonifies" the dict i put in the UI
    - db_config: value is not a valid dict
    Michael Adkins

    Michael Adkins

    1 week ago
    It needs to be sent as JSON, this actually looks like a client side bug in that it should parse this but doesn't try to. I'll open an issue. Thanks for reporting this!
    Tomás Emilio Silva Ebensperger

    Tomás Emilio Silva Ebensperger

    1 week ago
    Np, thanks!