Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com> Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>tags/1.8.0
| return format(obj, "f") | return format(obj, "f") | ||||
| if isinstance(obj, dict): | if isinstance(obj, dict): | ||||
| encoded_dict = {} | encoded_dict = {} | ||||
| allowed_keys = set(obj.keys()) | |||||
| for key, value in obj.items(): | for key, value in obj.items(): | ||||
| if ( | |||||
| (not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa"))) | |||||
| and (value is not None or not exclude_none) | |||||
| and key in allowed_keys | |||||
| if (not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa"))) and ( | |||||
| value is not None or not exclude_none | |||||
| ): | ): | ||||
| encoded_key = jsonable_encoder( | encoded_key = jsonable_encoder( | ||||
| key, | key, |
| # Init trial provider records if not exists | # Init trial provider records if not exists | ||||
| if ProviderQuotaType.TRIAL not in provider_quota_to_provider_record_dict: | if ProviderQuotaType.TRIAL not in provider_quota_to_provider_record_dict: | ||||
| try: | try: | ||||
| # FIXME ignore the type errork, onyl TrialHostingQuota has limit need to change the logic | |||||
| # FIXME ignore the type error, only TrialHostingQuota has limit need to change the logic | |||||
| new_provider_record = Provider( | new_provider_record = Provider( | ||||
| tenant_id=tenant_id, | tenant_id=tenant_id, | ||||
| # TODO: Use provider name with prefix after the data migration. | # TODO: Use provider name with prefix after the data migration. |