Skip to content

Commit

Permalink
patch odata $metadata (cf. tuomur/python-odata#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
fspot committed Jun 21, 2019
1 parent 7ce3ea4 commit ea94056
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
]

setup(name='toucan_connectors',
version='0.17.0',
version='0.17.1',
description='Toucan Toco Connectors',
author='Toucan Toco',
author_email='[email protected]',
Expand Down
12 changes: 12 additions & 0 deletions toucan_connectors/odata/odata_connector.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import pandas as pd
from odata import ODataService
from odata.metadata import MetaData

from toucan_connectors.common import Auth
from toucan_connectors.toucan_connector import ToucanConnector, ToucanDataSource


# monkey patch MetaData's __init__
# (cf. https://github.com/tuomur/python-odata/issues/22)
def metadata_init_patched(self, service):
self._original_init(service)
self.url = service.url.rstrip('/') + '/$metadata'


MetaData._original_init = MetaData.__init__
MetaData.__init__ = metadata_init_patched


class ODataDataSource(ToucanDataSource):
entity: str
query: dict
Expand Down

0 comments on commit ea94056

Please sign in to comment.