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
{{ message }}
Repository navigation
Commit ed6a0bc
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: one is_tier, in user_tables, used everywhere
The tier test was a closure over `table_name` defined inside
`_append_platform_attributes`, with a docstring narrating how job tables once
acquired `_prov` -- an incident the code no longer has.
`is_tier(table_name, tier)` now lives in user_tables.py beside the tier classes
it tests, takes both arguments explicitly, and carries one line of docstring.
Adopted at every boolean tier test in the library, replacing either a bare
`re.fullmatch(X.tier_regexp, name)` or hand-rolled prefix arithmetic:
- declare.py -- which tier receives which platform attribute
- deploy.py -- which tables add_prov_column touches
- schemas.py -- master lookup and the Part test
- user_tables.py -- _get_tier itself
- migrate.py -- _is_autopopulated_table, which had carried its own copy of the
prefix arithmetic, including the `"__" not in table_name[2:]` part-exclusion
that each tier_regexp already does by construction
What remains using `tier_regexp` directly is the definition of `is_tier` and one
`groupdict()` in schemas.py, which extracts the match rather than testing it.
deploy.py no longer needs `re` at all.
681 passed, 14 skipped.
0 commit comments