我尝试在 Azure Function 中运行以下脚本: init .py
import logging
import azure.functions as func
import pandas as pd
import numpy as np
from datetime import datetime
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
Run Code Online (Sandbox Code Playgroud)
这是 function.json:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "uwci-sftp-rb92351a6c-41fa-4b90-aa79-4e9974ca83f7/{name}",
"connection": ""
}
]
}
Run Code Online (Sandbox Code Playgroud)
当我仅导入 azure.functions 和日志记录时,它工作正常。我仅在尝试在 Azure Function 中运行代码时收到此错误。对于 pandas 或任何其他库,我收到以下错误:
Result: Failure
Exception: ModuleNotFoundError: No module named 'pandas'
Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", …Run Code Online (Sandbox Code Playgroud) python-3.x azure-blob-storage azure-functions azure-function-app
如何在SQL中的计算字段上使用order by?
select a.Customer
,a.PlanTo
,a.Dollar01
,a.Dollar02
,a.Dollar03
,a.Dollar04
,a.Dollar05
,a.Dollar06
,a.Dollar07
,a.Dollar08
,a.Dollar09
,a.Dollar10
,a.Dollar11
,a.Dollar12
,(CAST(a.Dollar01 as decimal) + CAST(a.Dollar02 as decimal)
+ CAST(a.Dollar03 as decimal) + CAST(a.Dollar04 as decimal)
+ CAST(a.Dollar05 as decimal) + CAST(a.Dollar06 as decimal)
+ CAST(a.Dollar07 as decimal) + CAST(a.Dollar08 as decimal)
+ CAST(a.Dollar09 as decimal) + CAST(a.Dollar10 as decimal)
+ CAST(a.Dollar11 as decimal) + CAST(a.Dollar12 as decimal)) as TOTAL1
from MDM_STAT.sds.SMarginText a
where a.salesyear = '2016'
order by a.total1
Run Code Online (Sandbox Code Playgroud)
这给了我'Total1'列不存在,但正如你所见,我创建了它并且如果我没有使用该order by子句,它正在工作.