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
Functions like list_models have boolean arguments supposedly determining whether or not to include certain data in the results, e.g. full, cardData, or fetch_config. The mix of camel case and snake case aside, being type hinted as boolean, one would expect this to toggle the respective feature using True/False. Instead, one has to pass None instead of False to disable it.
This smells of a possible misunderstanding of what cardData: typing.Optional[bool] = None means, in that typing.Optional doesn't in fact make the argument optional, it simply allows None being explicitly passed as a value. It is made optional simply by providing a default value, and so I suspect that a better way to define these signatures is simply using cardData: bool = False.
Reproduction
Setting cardData=False doesn't turn this option off (only setting it to None does):
Hi @buhrmann thanks for reporting ! That is definitely a bug and it seems to come from a server-side issue.
About the Optional[bool] / bool, I get your point. The slight difference between fetch_config=None and fetch_config=False is that in the first case the default behavior is decided by the server as in the second case it is hard-coded in the lib. This rule could be revisited but at least that's the short explanation about it.
EDIT 2: Will be solved from client-side. Behavior of the server is "if 'config' param is passed, return the config, no matter the value". So we will just stop sending 'config' if False or None.
Describe the bug
Functions like
list_models
have boolean arguments supposedly determining whether or not to include certain data in the results, e.g.full
,cardData
, orfetch_config
. The mix of camel case and snake case aside, being type hinted as boolean, one would expect this to toggle the respective feature usingTrue
/False
. Instead, one has to passNone
instead ofFalse
to disable it.This smells of a possible misunderstanding of what
cardData: typing.Optional[bool] = None
means, in thattyping.Optional
doesn't in fact make the argument optional, it simply allowsNone
being explicitly passed as a value. It is made optional simply by providing a default value, and so I suspect that a better way to define these signatures is simply usingcardData: bool = False
.Reproduction
Setting
cardData=False
doesn't turn this option off (only setting it to None does):Setting
fetch_config=False
doesn't turn this option off (only setting it to None does):Logs
No response
System Info
The text was updated successfully, but these errors were encountered: