Schema Browser in Workspaces

In App Workspaces, you have access to a schema browser for Data Sources linked to your app, allowing you to browse the contents of a data source.

You can also preview the data from data source tables or files and copy auto-generated code snippets to access the data from within a notebook or Python script.

Available Data Sources

All data sources linked to your app are available from the Data Sources menu in the workspace:

<img>

Select it to see a full list of data sources linked to the project.

<img>

If you haven’t linked any data sources, you can link one by selecting the Link Source button. See the Data Sources page for more details.

<img>

Otherwise, select a data source to connect to it. Once it loads, you’ll see the data structure of the source.

Note: If the data source has views, those are not displayed in the schema browser.

Properties and Types

If you are connecting to a Databricks, Snowflake, AWS Redshift, or Google BigQuery data source, select a table to see a list of its properties and their data types. Select a property name to copy it to the clipboard.

<img>

Data types displayed in the schema browser are displayed based on the types in the original data source for Databricks, Snowflake, AWS Redshift, and Google BigQuery.

For AWS S3, when the schema browser loads the data source, you’ll see the file structure of the bucket. You can select a .csv file to view the properties within it. As the files loaded are .csv files, the type for each property will be “String”.

Data Preview

From the table info view, select the Open Data Preview button to see up to the first 1000 rows in the table.

<img>

You can also access the data preview from the menu options beside a table:

<img>

Code Snippet

From the Data Preview page, select Copy Code to get code to run in your notebook to get the first 100 records from that table.

<img>

The copied code snippet uses dash_enterprise_libraries data_sources and will look similar to

from dash_enterprise_libraries import data_sources as ds
df = ds.read_sql("SELECT * FROM my_db.my_table LIMIT 100", "my_databricks")

You can also access a code snippet for any table without first opening the data preview by using the menu options beside a table name:

<img>

Refresh Data

To reload the data source in the schema browser, select Refresh Data from the menu options beside the data source name:

<img>