Data
Overview
The data node of the Davinci VSCode Extension navigation tree shows that data that is hosted within the
workspace. Data is placed into the workspace through two methods.
- Files located in the data folder within the workspace are automatically included as datasets
available in the workspace
- Scripts that call the val.set
function can place data within the workspace. This method can be used by user defined scripts, as well
as apps that are run within the workspace.
Workspace Data
The primary way to create data in your workspace is through the use of the val function in a script. Call set on val
will create a dataset in your workspace that is available to other scripts and tools.
The following code imports the val function, creates a dataset and puts it to the workspace. It then retrieves it
by calling val again.
from davinci.python import val
val.set('data', [{"age":24}])
data = val('data')
Local Data
When you
initialize
your davinci workspace, a folder named data is created in your workspace root folder.
Any file that is placed in that folder will automatically appear in your workspace as
a dataset.
Autmoatic Updates
When a dataset changes, either because the val.set function is called, or a file in the data folder changes,
the system tracks the change. If you have configured the system to propagate automatic updates in your
settings
the framework will automatically run any scripts or components that depend on the changed data.
Mapping Dependencies