I just realized how simple environment specific tables are when using the ENV dependency.
The Demo has a table data for the Published environment and a table data_dev for all other environments.
Create tables
Create tables data and data_dev with the same schema and populate some data in them.
Enable Accelerated Tables for dict like access to tables.
Setup ENV
Create the env table with the following setup:

Note that for the data_dev entry, the Published bool is None rather than False. None indicates this as the default value if the current environment can’t be matched to any other entry.
Use ENV
Allow ENV to select the correct table name
from ENV import environ
data_table = app_tables[environ.get('data_table')]
@anvil.server.callable
def get_data():
return data_table.search()
That’s it.
And we are done. The get_data() function in the Published app will use the data table and all other environments will use the data_dev table.
Demo
Publish a version of the app. Now try running the app in the development environment and hitting the app from your published URL.
ENV
ENV Clone
Third Party Dependency id: AFKPYPDLJMH2TYVK
github