Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to upload dataframe to SharePoint List #788

Closed
IlyaAspirent opened this issue Nov 28, 2023 · 2 comments
Closed

Failure to upload dataframe to SharePoint List #788

IlyaAspirent opened this issue Nov 28, 2023 · 2 comments
Labels

Comments

@IlyaAspirent
Copy link

IlyaAspirent commented Nov 28, 2023

All of scripts writing Dataframes to a Sharepoint list are now all failing.

Here is a sample of the upload script:

Username = "username"
Password = "password"
site_url = 'https://company.sharepoint.com/sites/TEST/'
ctx = ClientContext(site_url).with_credentials(UserCredential(user_name=Username, password=Password))
list_title = 'Provider_Master'
view_title = 'All Items'
page_size = 5000

list_action = ctx.web.lists.get_by_title(list_title)
items = list_action.items.get().top(page_size).execute_query()

ctx.load(list_action)
for index, row in df.iterrows():
print(row['MAPPING_SOURCE'], row['BUSINESS_UNIT_NAME'],row['PROVIDER_NPI'],row['PROVIDER_NAME'],row['NETSUITE_PROVIDER_ID'],row['NETSUITE_PROVIDER_NAME']
,row['NETSUITE_LOCATION_ID_LEGACY'],row['NETSUITE_LOCATION_NAME_LEGACY'],row['NETSUITE_LOCATION_ID'],row['NETSUITE_LOCATION_NAME'],row['LEGACY_PROVIDER_NAME']
,row['PROVIDER_TYPE'],row['SENIOR_DATE'],row['SBU'],row['DHS_POD'],row['HEALIX_PROVIDER_NAME'],row['HEALIX_NETSUITE_LOCATION_ID_LEGA'],row['HEALIX_NETSUITE_LOCATION_NAME_LE']
,row['HEALIX_NETSUITE_LOCATION_ID'],row['HEALIX_NETSUITE_LOCATION_NAME'],row['NETSUITE_PLATFORM_ID'],row['NETSUITE_SUBSIDIARY_ID_LEGACY'],row['NETSUITE_SUBSIDIARY_ID']
,row['DIVISION'],row['CITY'],row['PAYCOM_NAME'],row['PRIMARY_TAXONOMY'],row['PRIMARY_TAXONOMY_DESCRIPTION'],row['CORRECT_NAME']
)
list_action.add_item({'MAPPING_SOURCE': row['MAPPING_SOURCE'],'BUSINESS_UNIT_NAME': row['BUSINESS_UNIT_NAME'],'PROVIDER_NPI': row['PROVIDER_NPI']
,'PROVIDER_NAME': row['PROVIDER_NAME'],'NETSUITE_PROVIDER_ID': row['NETSUITE_PROVIDER_ID'],'NETSUITE_PROVIDER_NAME': row['NETSUITE_PROVIDER_NAME']
,'NETSUITE_LOCATION_ID_LEGACY': row['NETSUITE_LOCATION_ID_LEGACY'], 'NETSUITE_LOCATION_NAME_LEGACY': row['NETSUITE_LOCATION_NAME_LEGACY']
,'NETSUITE_LOCATION_ID': row['NETSUITE_LOCATION_ID'], 'NETSUITE_LOCATION_NAME': row['NETSUITE_LOCATION_NAME'],'LEGACY_PROVIDER_NAME': row['LEGACY_PROVIDER_NAME']
,'PROVIDER_TYPE': row['PROVIDER_TYPE'],'SENIOR_DATE': row['SENIOR_DATE'],'SBU': row['SBU'],'DHS_POD': row['DHS_POD'],'HEALIX_PROVIDER_NAME': row['HEALIX_PROVIDER_NAME']
,'HEALIX_NETSUITE_LOCATION_ID_LEGA': row['HEALIX_NETSUITE_LOCATION_ID_LEGA'],'HEALIX_NETSUITE_LOCATION_NAME_LE': row['HEALIX_NETSUITE_LOCATION_NAME_LE']
,'HEALIX_NETSUITE_LOCATION_ID': row['HEALIX_NETSUITE_LOCATION_ID'],'HEALIX_NETSUITE_LOCATION_NAME': row['HEALIX_NETSUITE_LOCATION_NAME']
,'NETSUITE_PLATFORM_ID': row['NETSUITE_PLATFORM_ID'],'NETSUITE_SUBSIDIARY_ID_LEGACY': row['NETSUITE_SUBSIDIARY_ID_LEGACY'],'NETSUITE_SUBSIDIARY_ID': row['NETSUITE_SUBSIDIARY_ID']
,'DIVISION': row['DIVISION'],'CITY': row['CITY'],'PAYCOM_NAME': row['PAYCOM_NAME'],'PRIMARY_TAXONOMY': row['PRIMARY_TAXONOMY'],'PRIMARY_TAXONOMY_DESCRIPTION': row['PRIMARY_TAXONOMY_DESCRIPTION']
,'CORRECT_NAME': row['CORRECT_NAME']})
ctx.execute_batch()

ClientRequestException: ('-1, System.UriFormatException', 'Invalid URI: The Uri string is too long.', '500 Server Error: Internal Server Error for url: https://company.sharepoint.com/sites/Site/_api/$batch')

@IlyaAspirent
Copy link
Author

I have confirmed that the above code works perfectly using version 2.3.1.

@vgrem vgrem added the bug label Dec 6, 2023
vgrem added a commit that referenced this issue Aug 10, 2024
@vgrem
Copy link
Owner

vgrem commented Aug 11, 2024

Greetings,

thank you for reporting it, this issue has been addressed in 2.5.12 version

@vgrem vgrem closed this as completed Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants