【发布时间】:2021-09-30 12:04:20
【问题描述】:
#pyspark函数#
def get_config(env)
if env == 'local':
with open(f"src/config/config_{env}.yml", "r") as stream:
try:
data = yaml.safe_load(stream)
return data
except yaml.YAMLError as exc:
print("Error in reading CONFIG file")
else:
print("Error in reading CONFIG file")
【问题讨论】:
-
你想在这里做什么?我无法按照目前的方式关注问题
-
我已经编写了 pyspark 函数,我需要为单元测试创建 pytest 函数
-
也许
io.TextIOWrapper可以帮助你。您可以找到一些使用示例here。
标签: python pyspark pytest-mock