-1

Trying to develop Python Application using Flask, to consume OData services to connect to SAP HANA. When trying to open the url, the whole application crashes and I get a DeprecationWarning. What's the purpose of DeprecationWarnings?

from flask import Flask, render_template, request
from pyslet.odata2.client import Client
from pyslet.http.auth import BasicCredentials
from pyslet.http.client import Client as http
from pyslet.http.client import ClientRequest

app = Flask(__name__)

@app.route('/')
def test():
    return('test')

@app.route('/odata')
def hello():
    table = testClient()
    return render_template('odata.html', table=table)

def testClient():
    c = MyAuthenticatedClient('link to xso data')
    table = c.feeds['MarketShareFSet'].OpenCollection()
    tablenames = []
    for t in table.iteritems():
        c1 = p['ID'].value
        c2 = p['Country'].value
        c3 = p['Hub'].value
        c4 = p['Division'].value
        tablenames.append((c1, c2,c3,c4))

    return tablenames
127.0.0.1 - - [13/Mar/2019 13:59:40] "GET / HTTP/1.1" 200 -
main.py:23: DeprecationWarning: EntitySet.OpenCollection is deprecated, use open instead
  table = c.feeds['MarketShareFSet'].OpenCollection()
davidism
  • 121,510
  • 29
  • 395
  • 339
russianmax
  • 157
  • 1
  • 12

1 Answers1

1

From Wikipedia:

In several fields, deprecation is the discouragement of use of some terminology, feature, design, or practice, typically because it has been superseded or is no longer considered efficient or safe, without completely removing it or prohibiting its use.

It is warning you that the OpenCollection() method is now not the best option to use (for whatever reason) and best practice would be to use the open() method instead.

Typically in software, things become depreciated then, later on, are no longer supported or removed from later versions of a release.

dijksterhuis
  • 1,225
  • 11
  • 25