【问题标题】:Great Expectations: base_directory must be an absolute path if root_directory is not provided寄予厚望:如果未提供 root_directory,则 base_directory 必须是绝对路径
【发布时间】:2021-05-12 03:12:06
【问题描述】:

这是关于 Python 中的 Great Expectations 模块,主要用于数据质量检查(我发现他们的文档不充分)。因此,我一直在尝试在我的笔记本上设置数据上下文(使用本地数据源) - 如下所述:

https://docs.greatexpectations.io/en/latest/guides/how_to_guides/configuring_data_contexts/how_to_instantiate_a_data_context_without_a_yml_file.html#how-to-guides-configuring-data-contexts-how-to-instantiate-a-data-context-without-a-yml-file

以下是我的代码:

from great_expectations.data_context.types.base import DataContextConfig
from great_expectations.data_context.types.base import DatasourceConfig
from great_expectations.data_context.types.base import FilesystemStoreBackendDefaults
from great_expectations.data_context import BaseDataContext

data_context_config = DataContextConfig(
    datasources={
        "debaprc_test": DatasourceConfig(
            class_name="PandasDatasource",
            batch_kwargs_generators={
                "subdir_reader": {
                    "class_name": "SubdirReaderBatchKwargsGenerator",
                    "base_directory": "/Users/debaprc/Downloads"              
                }
            },
        )
    },
    store_backend_defaults=FilesystemStoreBackendDefaults(root_directory="/Users/debaprc/GE_Test/New/")
)

context = BaseDataContext(project_config=data_context_config)

这是我得到的错误:

base_directory must be an absolute path if root_directory is not provided

我做错了什么?

【问题讨论】:

    标签: python data-quality great-expectations


    【解决方案1】:

    非常感谢您使用 Great Expectations。这是我们最新升级的检查点功能的一个已知问题,该功能已在我们的开发分支中修复。请从开发分支安装或等到我们本周发布的下一个版本 0.13.9。

    【讨论】:

    • 非常感谢。我对纯粹从笔记本电脑运行 GE 有另一个疑问。我注意到没有关于如何拥有 S3 数据源的文档(在上面提到的链接中)。这也是将在以后的版本中添加的东西吗?或者如果它已经是一项功能,您能否分享一个链接或其他内容?
    • 嗨@DebapratimChakraborty!查看操作指南中的How to configure a Pandas/S3 Datasource 和我们的Configuring Datasources 部分,了解有关在 S3 上创建数据源的更多信息。如果你有一个文件系统,你可以使用 yml 配置,如果没有,你可能需要将我们文档中的 yml 翻译成 python - 你提到的链接中有几个例子。
    • 您也不妨查看我们的网站,该网站有一个链接到我们的 slack 社区,该社区有一个专门用于支持的频道:greatexpectations.io
    猜你喜欢
    • 2021-07-13
    • 2022-10-22
    • 2022-10-04
    • 2022-07-12
    • 2021-09-19
    • 2022-12-15
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    相关资源
    最近更新 更多