kopia lustrzana https://github.com/simonw/datasette
Use None as a default arg (#901)
Thanks, @fcatus! * Use None as a default arg * Black formatting fix Co-authored-by: Simon Willison <swillison@gmail.com>pull/927/head
rodzic
d71b0c0cb9
commit
2d7fa8b905
|
@ -191,7 +191,9 @@ class Filters:
|
||||||
)
|
)
|
||||||
_filters_by_key = {f.key: f for f in _filters}
|
_filters_by_key = {f.key: f for f in _filters}
|
||||||
|
|
||||||
def __init__(self, pairs, units={}, ureg=None):
|
def __init__(self, pairs, units=None, ureg=None):
|
||||||
|
if units is None:
|
||||||
|
units = {}
|
||||||
self.pairs = pairs
|
self.pairs = pairs
|
||||||
self.units = units
|
self.units = units
|
||||||
self.ureg = ureg
|
self.ureg = ureg
|
||||||
|
|
|
@ -626,7 +626,11 @@ def module_from_path(path, name):
|
||||||
return mod
|
return mod
|
||||||
|
|
||||||
|
|
||||||
async def resolve_table_and_format(table_and_format, table_exists, allowed_formats=[]):
|
async def resolve_table_and_format(
|
||||||
|
table_and_format, table_exists, allowed_formats=None
|
||||||
|
):
|
||||||
|
if allowed_formats is None:
|
||||||
|
allowed_formats = []
|
||||||
if "." in table_and_format:
|
if "." in table_and_format:
|
||||||
# Check if a table exists with this exact name
|
# Check if a table exists with this exact name
|
||||||
it_exists = await table_exists(table_and_format)
|
it_exists = await table_exists(table_and_format)
|
||||||
|
|
Ładowanie…
Reference in New Issue