jet-admin / jet-bridge

Consider using f-strings PYL-C0209
Performance
Minor
a month ago2 years old
Formatting a regular string which could be a f-string
209                elif isinstance(query_type, (sqltypes.JSON, sqltypes.ARRAY, sqltypes.Enum)):
210                    return cast(field, sqltypes.String).ilike('%{}%'.format(search))
211                elif isinstance(query_type, sqltypes.String):
212                    return field.ilike('%{}%'.format(search))213
214            operators = list(filter(lambda x: x is not None, map(map_column, data.get('columns', []))))
215            queryset = queryset.filter(or_(*operators))
Formatting a regular string which could be a f-string
207                if isinstance(query_type, (sqltypes.Integer, sqltypes.Numeric)):
208                    return cast(field, sqltypes.String).__eq__(search)
209                elif isinstance(query_type, (sqltypes.JSON, sqltypes.ARRAY, sqltypes.Enum)):
210                    return cast(field, sqltypes.String).ilike('%{}%'.format(search))211                elif isinstance(query_type, sqltypes.String):
212                    return field.ilike('%{}%'.format(search))
213
Formatting a regular string which could be a f-string
190                if value is None and item.lookup == lookups.DEFAULT_LOOKUP:
191                    argument_name = item.name
192                    if item.exclude:
193                        argument_name = 'exclude__{}'.format(argument_name)194                    value = get_filter_value(argument_name, item)
195            else:
196                value = None
Formatting a regular string which could be a f-string
184            if item.name:
185                argument_name = '{}__{}'.format(item.name, item.lookup)
186                if item.exclude:
187                    argument_name = 'exclude__{}'.format(argument_name)188                value = get_filter_value(argument_name, item)
189
190                if value is None and item.lookup == lookups.DEFAULT_LOOKUP:
Formatting a regular string which could be a f-string
182
183        for item in filters_instances:
184            if item.name:
185                argument_name = '{}__{}'.format(item.name, item.lookup)186                if item.exclude:
187                    argument_name = 'exclude__{}'.format(argument_name)
188                value = get_filter_value(argument_name, item)