chicago-joe
10/12/2021, 4:28 PMValueError: Flow could not be deserialized successfully. Error was: ValidationError({'schedule': {'clocks': {0: {'parameter_defaults': defaultdict(<class 'dict'>, {'accnt': {'value': ['Field may not be null.']}, ....
std_inputs = { 'report':False,
'accnt': None, # string - delimited list
'strategy': None, # string - delimited list
'institutionalAdvisor':None, # string - delimited list
'endDate': None, # string - 'YYYY-MM-DD'
'shadow': None, # SPY, treasury
'benchmark': None, # SPY, PUT, BXM
'fees': False, # Bool
'output': 'daily' # monthly, daily
}
with Flow('Update Performance tables',
schedule = Schedule(
clocks = [
CronClock("7 6 * * 1-5",
start_date=pendulum.now("America/Chicago"),
parameter_defaults = std_inputs)]...
Any help would be greatly appreciated!Kevin Kho
Parameter
? Is it required and what is the default? Looking for accnt
specificallynicholas
accnt
that you’re setting to None
in your parameter defaults. For any required parameters you’ll need to set a default therechicago-joe
10/12/2021, 10:40 PMaccnt = Parameter('accnt', default = None)
@nicholas is correct, but this is intentional, as this script is a performance reporting module that takes a variety of inputs, where you can view the report for an account, for multiple accounts, or even entire strategies as whole. This input = None by default is by design on our sidechicago-joe
10/12/2021, 10:41 PMKevin Kho
required=False
if you can bypass it?chicago-joe
10/14/2021, 1:05 PMArgs:
- name (str): the Parameter name.
- default (any, optional): A default value for the parameter. Must be a JSON-Serializable type.
- required (bool, optional): If True, the Parameter is required and the
default value is ignored. Defaults toif aFalse
isdefault
provided, otherwise.True
chicago-joe
10/14/2021, 1:09 PMFalse
will return None
..
class DateTimeParameter(Parameter):
Args:
- name (str): the Parameter name.
- required (bool, optional): If True, the Parameter is required. Otherwise, it is optional and will returnif no value is provided.None
chicago-joe
10/14/2021, 1:11 PMKevin Kho
chicago-joe
10/18/2021, 2:20 PM