Seems to be a limit on updated rows
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với hàm main Python được cung cấp và liên kết đầu ra SQL PersonnelItems của hàm đó, sau đó so sánh các lần chạy với 1,000 và 2,000 bản ghi được mô tả trong báo cáo. Kiểm tra xem các lỗi cột không hợp lệ thay đổi có phải do cách thư viện xử lý đầu ra SqlRow theo lô hay không; hoàn thành khi nhập được khoảng 4,000 phần tử nhân sự mà không có lỗi cột và giữ nguyên tất cả các hàng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Check for a solution in the Azure portal
Done. Nothing found.
Investigative information
- Timestamp: 2023-04-21 14:19:47.401
- Function App version: 4.17.3.3
- Function App name: cardAccess
- Function name(s) (as appropriate): PersonnelFileTrigger
- Invocation ID: 8a20b815-a601-4ab0-b61d-025147fef78b
- Region: EastUS
Repro steps
Provide the steps required to reproduce the problem:
Import an XMl file with more than 1,000 elements
Expected behavior
Import an XML file of ~4,000 personnel elements
All should appear in the target SQL server table
Actual behavior
Import an XML file of ~4,000 personnel elements
When I import only 1,000 records, it works fine. In the code:
start_recno = 0
end_recno = 1000
When I import only the 2nd thousand records, it works fine. In the code:
start_recno = 1000
end_recno = 2000
When I import 2,000 records I get a meaningless error message. Code:
start_recno = 0
end_recno = 2000
2023-04-21 14:19:53.808
Invalid column name 'Text4'. Invalid column name 'Text4'.
Error
Note: The target table indeed does have such a column, and it was populated by smaller runs. The reported Invalid column varies from run to run. Sometimes Text4, sometimes Text6 and Text7, sometimes MiddleName. Seemingly random, but all valid columns.
Known workarounds
none
Related information
Provide any related information
- Programming language used: Python
- Links to source: https://portal.azure.com/#view/WebsitesExtension/FunctionMenuBlade/~/code/resourceId/%2Fsubscriptions%2F8a237898-8564-4180-9423-9c9befb66299%2FresourceGroups%2Fcn100898%2Fproviders%2FMicrosoft.Web%2Fsites%2FcardAccess%2Ffunctions%2FPersonnelFileTrigger
- Bindings used
{
"bindings": [
{
"name": "myblob",
"path": "ccure/Personnel/{name}",
"connection": "recurringintegrations_STORAGE",
"direction": "in",
"type": "blobTrigger"
},
{
"name": "PersonnelItems",
"type": "sql",
"direction": "out",
"commandText": "dbo.Personnel",
"connectionStringSetting": "live_100898"
},
{
"name": "CredentialItems",
"type": "sql",
"direction": "out",
"commandText": "dbo.Credential",
"connectionStringSetting": "live_100898"
}
]
}
Source
import logging
import azure.functions as func
import xml.etree.ElementTree as ET
from datetime import datetime
def main(myblob: func.InputStream, PersonnelItems: func.Out[func.SqlRow], CredentialItems: func.Out[func.SqlRow]):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob uri: {myblob.uri} \n")
XMLContent = myblob.read()
# create element tree object from string and start at root
root = ET.fromstring(XMLContent)
# iterate items
start_recno = 0
end_recno = 1000
recno = 0
debug = True
rows = []
for item in root.findall('./SoftwareHouse.NextGen.Common.SecurityObjects.Personnel'):
recno = recno + 1
if recno < start_recno:
continue
if recno >= end_recno:
break
now_datetime = datetime.now().replace(microsecond=0).isoformat()
row_d = {"ImportDate": now_datetime, "FileName": myblob.name, "RecordNumber": recno }
for child in item:
if child.tag == 'SoftwareHouse.NextGen.Common.SecurityObjects.Credential': # skip detail for now
continue
if "LastModifiedTime" in child.tag:
orig_date = child.text
date_obj = datetime.strptime(orig_date[:-9].strip(), "%m/%d/%Y %I:%M:%S %p")
iso_date = date_obj.isoformat()
row_d[child.tag] = iso_date
else: # "normal" elements
row_d[child.tag.strip()] = child.text.strip()
if debug:
logging.info(f"{row_d}")
# store in a list
rows.append(func.SqlRow(row_d))
# write the list of rows to the database
PersonnelItems.set(rows)
logging.info(f"row count: {recno}")
- Ngôn ngữ chính
- Python
- Star
- 179
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-functions-python-library
-
McpPropertyType.FLOAT emits invalid JSON Schema type "float" in MCP tool inputSchemaCó thể đã có người làm @zecloud đã nhận 8 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
area:python-functions
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
area:python-functions
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Azure/azure-functions-python-library#226 · 1 bình luận · 2 reaction ·
Tất cả issue của Azure/azure-functions-python-library
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NVIDIA/earth2studio#1241 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
docs(types): update the collection binding note now that typed collections shipped in pycubrid 1.9.0Đang mởdocumentation priority: low size: S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cubrid-lab/sqlalchemy-cubrid#768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
--csv-bom was never wired up: PR #850 added an unused helper parameter, so #846 is not fixedĐang mởbug help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Broken link in index.rstĐang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
ansys/pydpf-core#3547 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OktoLabsAI/okto-pulse#114 ·
Maintainer thường phản hồi trong vòng 1 ngày