简体   繁体   中英

Getting warning message after importing data into a python IBM watson Studio

I am importing the data set set and getting the above warning and not able to understand which function is causing this warning.

DeprecationWarning: You are using the post() function from 'ibm_botocore.vendored.requests'. This is not a public API in ibm_botocore and will be removed in the future. Additionally, this version of requests is out of date. We recommend you install the requests package, 'import requests' directly, and use the requests.post() function instead.

Code

import types
import pandas as pd
from botocore.client import Config
import ibm_boto3

def __iter__(self): return 0

client_cbe8a2731f0140ccb1120588edd17f92 = ibm_boto3.client(service_name='s3',
    ibm_api_key_id='xxx',
    ibm_auth_endpoint="https://yy",
    config=Config(signature_version='oauth'),
    endpoint_url='https://zz.com')

body = `enter code here`client_cbe8a2731f0140ccb1120588edd17f92.get_object(Bucket='abc',Key='data.csv')['Body']
# add missing __iter__ method, so pandas accepts body as file-like object
if not hasattr(body, "__iter__"): body.__iter__ = types.MethodType( __iter__, body )

data = pd.read_csv(body)

Try shutting down and restarting your Kernel. I was running in a Jupyter Notebook with the identical issue. Shutdown/Restart seemed to resolve!

Update... I must have been lucky. I am still seeing this message randomly. I can not discern any pattern.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM