dbx
dbx copied to clipboard
question
hi,
I have a python file of a tasks is called update.py - which is called by dbx. the python file calls the databricks api - which requires a DATABRICKS_TOKEN. how can I pass the DATABRICKS_TOKEN to the python file - which is part of a task of a workflow?
I already checked the docs - but was not able to find anything.
thanks
Well dbx is CLI tool, u export databricks token as environment variable export DATABRICKS_TOKEN= or configure it within .databrickscfg. https://docs.databricks.com/dev-tools/cli/index.html
@ptabandzelic ok that sounds like a plan - at what stage to call the export DATABRICKS_TOKEN= ?
before I call dbx deploy? what happens if the python file is called by the scheduler - is that env var still available? -> https://dbx.readthedocs.io/en/latest/reference/deployment/?h=or#scheduling-workflows
I think another way would be that jinja support? https://dbx.readthedocs.io/en/latest/features/jinja_support/
Bro i think u are confused.
hi @Arnold1 ,
Could you please explain a bit more in detail what you're doing?
Do I understand correctly that:
- You have a task in Databricks, the code of this task is in
some_pkg/update.py - Inside this task you would like to access the
DATABRICKS_HOSTandDATABRICKS_TOKENvariables to call specific Databricks APIs?
hi @renardeinside
I want to create a one time run. I create a schedule for a specific time if the job runs I want to delete it.