Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.API ReferenceCLI ReferenceRelease Notes
Version: 2.3.0

tdk fn register

Register a function. Runs the code of the '--path' file on this

machine, since it imports it.

Dynamically imports the symbol named by --path (which must be a tabsdatak PublisherInfo / TransformerInfo / SubscriberInfo produced by a @publisher / @transformer / @subscriber decorator) and registers it via the v2 bundle producer (tabsdatak.common._archive.bundle.build_bundle).

With --update, behaves idempotently: if the function already exists in the collection it is updated; otherwise it is registered.

With --dry-run, checks the function as 'tdk fn check --coll' does and reports what would be registered, uploading nothing.

tdk fn register \
--proj quickstart \
--format table \
--coll <function pinned.<locals>.default at 0x10b614d60> \
--description Ingests raw sales data from Postgres \
--path functions/read_world.py::read_world \
--dir-to-bundle ./qs-example \
--requirements requirements.txt \
--local-pkg ./dist/mypkg-1.0.0-py3-none-any.whl \
--reuse-tables \
--enabled \
--update \
--storage-path /prod \
--dry-run \
--profile production
FlagTypeRequiredDescription
--proj, -PstringOptionalProject to target; overrides the pinned project. Prompted for when a command needs one and neither is set.
-o, --formattable | json | yamlOptionalOutput format. 'json' and 'yaml' give a listing as an array and table data as one object per row.
--coll, -cstringOptionalName of the collection to which the function belongs. Defaults to <function pinned.<locals>.default at 0x10b614d60>.
--descriptionstringOptionalDescription of the function.
--pathstringRequiredPath to the function file. Must be of the form '/path/to/file.py::function_name'. Will be prompted for it if not provided.
--dir-to-bundlestringOptionalPath to the directory that should be stored in the bundle for execution in the backend. If not provided, the folder where the function file is will be used.
--requirementsstringOptionalPath to a requirements.yaml to embed in the bundle verbatim, instead of the snapshot of this machine's Python environment. Use it when the runtime environment differs from this one.
--local-pkgstringOptionalPath to a local package directory to include in the bundle; repeatable. Local packages are pip-installed into the function's runtime environment, separately from the '--dir-to-bundle' source tree. Import them absolutely ('import mypkg'). If a local package shares a name with a module in that tree, the installed package wins at runtime.
--reuse-tablesflagOptionalReuse previously created tables. If provided, any tables that the function produces that already exist in the system (but no longer have a function that generates them) will be reused, adding to their data history. If not provided, those tables will be recreated and their data history re-initialized.
--enabled, --disabledflagOptionalEnable or disable the feature
--updateflagOptionalIf provided, update the function if it already exists in the collection. If not present, the command falls through to the normal register flow.
--storage-pathstringOptionalOptional storage-prefix override for this function's output table data. When omitted, the collection's base_path is used.
--dry-runflagOptionalCheck the function as 'tdk fn check' does and show what would be registered, without uploading anything.
--profilestringOptionalProfile whose login and pinned project and collection this command uses; with no NAME, the default profile. Default: the profile set with 'tdk set --profile', else the default profile.