芝加哥出租车示例中的_tfx_root指的是什么?为什么需要它?
元数据结束管道在~/tfx中结束,但没有tfx git repo的本地副本,它不能在气流中(本地)运行。
元数据目录是在手动将管道airflow initdb文件复制到$AIRFLOW_HOME/dags/blabla目录后,在运行Python时创建的。不过,如果能够配置~/tfx的位置就更好了。你知道怎么做吗?
发布于 2019-04-01 16:53:15
code:- _tfx_root = os.path.join(os.environ['HOME'], 'tfx'); 它用于定义名为'tfx'的目录的相对路径,该目录是在登录用户的主目录(如果不存在)中创建的。其中HOME是一个环境变量。
code:- _pipeline_root = os.path.join(_tfx_root, 'pipelines');使用相对路径创建/附加子目录"pipelines" to tfx_root path。
code:- _metadata_db_root = os.path.join(_tfx_root, 'metadata');使用相对路径创建/附加子目录"metadata" to tfx_root path。
code:- _log_root = os.path.join(_tfx_root, 'logs');使用相对路径创建/附加子目录"logs" to tfx_root path。
发布于 2019-04-01 16:43:42
它是数据目录的路径。此变量仅用于构建管道、元数据和根目录的路径。
_tfx_root = os.path.join(os.environ['HOME'], 'tfx'); // Create location ~/tfx
_pipeline_root = os.path.join(_tfx_root, 'pipelines'); // Join ~/tfx/pipelines/
_metadata_db_root = os.path.join(_tfx_root, 'metadata'); // Join ~/tfx/metadata/
_log_root = os.path.join(_tfx_root, 'logs'); // Join ~/tfx/logs/只需修改_tfx_root以更改~/tfx的位置即可。如果您希望位置为C:/temp/tfx。以此为例。
_tfx_root = 'C:/temp/tfx/';https://stackoverflow.com/questions/55262209
复制相似问题