你可以在Snowpark中从GitHub运行Python代码吗?

huangapple go评论68阅读模式
英文:

How do I Run python code from github in snowpark?

问题

我有一些自定义代码在https://git..../function.py
我想从Git中获取这段代码,并在Snowpark中的Python工作表中运行它。

我该如何设置这个?我对Snowpark还很陌生。

我发现很难找到有用或清晰的关于这方面的说明。

英文:

I have some custom code in https://git..../function.py
I want to fetch this code from git and run it within a python worksheet in snowpark.

How do I set this up? I am new with Snowpark.

I find it very difficult to find useful or clear instructions on this.

答案1

得分: 2

Python工作表旨在直接在Snowflake UI的工作表中编写代码并运行Snowpark Python。目前还没有Git和Python工作表之间的集成可用。您需要将代码复制到工作表中,或将.py代码放入一个阶段,然后从阶段导入Python代码到工作表。

有关Python工作表的详细信息,请参阅文档:https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets#add-a-python-file-from-a-stage-to-a-worksheet

或者,您可以通过Jupyter Notebook在Snowpark Python中运行您的Git代码 - 但在这种情况下,您需要自己设置环境。您可以在此示例Snowflake Lab中查看如何操作的指南:https://github.com/Snowflake-Labs/snowpark-python-demos/tree/main/Advertising-Spend-ROI-Prediction

英文:

Python worksheets are intended for writing the code directly in the worksheet in the Snowflake UI and running Snowpark Python directly in the worksheet. As it stands now, there isn't an integration available between git and a Python worksheet. You would need to copy your code into the worksheet, or put your .py code into a stage and then import the Python code into your worksheet from the stage.

See for reference the docs on Python worksheets: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets#add-a-python-file-from-a-stage-to-a-worksheet

Alternatively, you could run your git code in Snowpark Python via a Jupyter Notebook - but in this case, you would need to set up your environment yourself. You can follow the guide on how to do this in this example Snowflake Lab: https://github.com/Snowflake-Labs/snowpark-python-demos/tree/main/Advertising-Spend-ROI-Prediction

huangapple
  • 本文由 发表于 2023年6月27日 17:45:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76563602.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定