简体   繁体   English

在 Foundry 代码存储库中,如何从 Python 转换中记录调试消息?

[英]In a Foundry Code Repository, how do I log debug messages from within a Python transform?

Is there any way to introduce debugging statements in your Transforms code, so you can later see them in driver logs, for example?有没有什么办法可以在你的 Transforms 代码中引入调试语句,以便你以后可以在驱动程序日志中看到它们,例如? Or is raising exceptions the only way to do this?或者抛出异常是唯一的方法吗?

Yes this is possible as of transforms-python 1.9.0 driver logs get written to the transaction.是的,从 transforms-python 1.9.0 驱动程序日志写入事务开始,这是可能的。 You can use python logging to write logs.您可以使用python logging来编写日志。 For example:例如:

import logging
log = logging.getLogger(__name__)

def my_transform(input):
    log.info("Testing logging")
    return input

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Foundry 中的代码存储库编写或创建外部数据集 - How to write or create external dataset from code repository within Foundry 如何从 Blobster API 获取文件到 Foundry 转换? - How do I get a file from the Blobster API into a Foundry Transform? 如何将数据集转换为 repo 中的字典。 我在铸造厂内使用 pyspark - How do I transform the data set into a dictionary inside the repo. I am using pyspark within foundry 如何在 Foundry Code Authoring 的 python 转换环境中使用 sqlContext(执行 SQL 查询)? - How can I use sqlContext (to execute SQL queries) in the python transform environment in Foundry Code Authoring? 如何将日志从代工厂平台的代码库写入新文件 - How to Write logs into new file from Code Repository in foundry Platform 如何在 Foundry Code Workbook 中生成身份验证令牌以用作 API 的参数? - How do I generate authentication tokens within Foundry Code Workbook to use as an argument to APIs? 如何在代码工作簿中合并 Palantir Foundry 中的两个数据集? - How do I union two datasets in Palantir Foundry within a code workbook? 如何在代码工作簿中加入 Palantir Foundry 中的两个数据集? - How do I JOIN two datasets in Palantir Foundry within a code workbook? 在 Palantir Foundry 中,我怎样才能只在我的 Python Transform 的某些分支上运行测试? - In Palantir Foundry, how can I only run tests on some branches of my Python Transform? 如何从代码存储库中找到 Foundry API? - How can I hit a Foundry API from Code Repositories?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM