-
Notifications
You must be signed in to change notification settings - Fork 93
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
Odata v4 #77
base: wip-odata-v4
Are you sure you want to change the base?
Odata v4 #77
Commits on Nov 7, 2019
-
Splits python representation of metadata and its parser
The current implementation of python representation of metadata and metadata parser was tightly interconnected. Support for other versions of OData was not possible as in each version elements are added, removed or modified. Therefore, we decided to split metadata representation and its parser. With this approach, we can easily define supported elements and its parsing functions in a single class. This "configuration" class is stateless and has to be a child of ODATAVersion. Additional changes including updating directory structure and refactoring old code to accommodate for incoming ODATA V4 support. New module model: - builder -> MetadataBuilder was moved here to make code easier to read elements -> All EDM elements were moved here, to make python representation of elements version independent. All parsable elements have to inherit from "from_etree_mixin". - from_etree_callbacks -> All from_etree static methods were moved into separated function. This is a naive approach as its premise is that all from_etree implementations will be reusable in version V4. - types_traits -> "types traits" were moved here to make code cleaner and easier to read. Module V2: - __init__ -> includes OData2 definition. - service -> function-wise nothing has been changed. "Main" module: - config -> class Config was moved here to make it version and model-independent. In case we will ever need a config class also for service. Also ODataVersion class lives here. - policies -> All policies were moved here as well as ParserError enum. Again to make policies version and model-independent. Tests were only updated to incorporate new API.
Configuration menu - View commit details
-
Copy full SHA for 3515a36 - Browse repository at this point
Copy the full SHA 3515a36View commit details
Commits on Nov 8, 2019
-
Add separate type repository for each child of ODATAVersion
In every release of OData new types are not only added and removed but also there are changes to the existing types notably in formatting. Thus, there is a need to have separate type repository for each OData version. Let's see an example of Edm.Double JSON format: OData V2: 3.141d OData V4: 3.141 https://www.odata.org/documentation/odata-version-2-0/overview/#AbstractTypeSystem http://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html
Configuration menu - View commit details
-
Copy full SHA for c93cccd - Browse repository at this point
Copy the full SHA c93cccdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b0f622 - Browse repository at this point
Copy the full SHA 2b0f622View commit details -
Add implementation of schema for OData V4
- Enum types is working - Complex type is working(including BaseType) - Entity type needs editing
Configuration menu - View commit details
-
Copy full SHA for f2b854b - Browse repository at this point
Copy the full SHA f2b854bView commit details
Commits on Nov 13, 2019
-
Change the implementation of dynamic dispatch function
from_etree
MixinFromEtree was removed in favour of the function called build_element. This is because A) Not always etree was passed, so the name was misleading. B) The purpose of splitting model and parse function was to be able to reuse certain part of code among different version of ODATA, but that was not fully possible with the previous solution as you had to import given element's class(which could be different for each version). Thus, you would have to introduce unnecessary inherency to solve this. New function build_element takes two positional arguments and rest is kwargs. First one is element's class or element's class name as a string. Element class is preferred as it makes refactoring easier and does not introduce magical strings to the code. The name string option is here to solve those cases when you cant import needed element class due to version differences. Second argument is config.
Configuration menu - View commit details
-
Copy full SHA for aa68a10 - Browse repository at this point
Copy the full SHA aa68a10View commit details -
Fix test_types_repository_separation test
Previous test was faulty as it relied on being call before any other test initiated ODataV2.Types.
Configuration menu - View commit details
-
Copy full SHA for 03e866b - Browse repository at this point
Copy the full SHA 03e866bView commit details
Commits on Dec 20, 2019
-
Add support for NavigationTypeProperty in V4
Functions and elements removed/replaced in V4 corresponding with NavigationTypeProperty were moved to v2 module.
Configuration menu - View commit details
-
Copy full SHA for 27302d2 - Browse repository at this point
Copy the full SHA 27302d2View commit details -
Remove enum type from OData V2
Despite implementing enum for V2 the first mention of enum in specification is only in later versions of OData. Thus, it should not be possible to parse enum using V2 parser.
Configuration menu - View commit details
-
Copy full SHA for c7f8f72 - Browse repository at this point
Copy the full SHA c7f8f72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ab9113 - Browse repository at this point
Copy the full SHA 5ab9113View commit details -
Add support for TypeDefinition in OData V4
TypeDefinitions are simply aliases for primitive types. They can be annotated. Thus, reimplementation of annotation for V4 is included in this commit. Children of ODataVersion have to specify which annotations are supported and how they should be processed. Annotation are parsed using function 'build_annotation'. As annotation are always tied to specific element and there is no centralized repository of annotations this function must return void. http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part3-csdl/odata-v4.0-errata03-os-part3-csdl-complete.html#_Toc453752574
Configuration menu - View commit details
-
Copy full SHA for 9c47514 - Browse repository at this point
Copy the full SHA 9c47514View commit details -
Change implementation of struct type build functions
They(EnumType, EntityType, ComplexType) now handle parsing of invalid metadata independently. Thus, you do not have to wrap build_element in try-except block. Build function either return valid type, null type or fails. (Last two options depend on which policy is set.)
Configuration menu - View commit details
-
Copy full SHA for 21c944d - Browse repository at this point
Copy the full SHA 21c944dView commit details -
Add V4 to pyodata cmd interface
Also imports' paths were updated to correctly reflect project structure.
Configuration menu - View commit details
-
Copy full SHA for 92a12bc - Browse repository at this point
Copy the full SHA 92a12bcView commit details -
Fix import error in python 3.6
In Python 3.7 importlib which resolves imports was updated. It allowed to use "import x.y as c" in __x__.py, but as we support python 3.6 as well we needed to optimize to work properly even with previous versions of importlib. Thus, the reason for this commit. All imports of files defined in the same folder as __module__.py are now in the form of "from .x import a,b,c". Also, since now all relevant classes for using pyodata e. g. elements, types are now directly imported in the appropriate module. User should always use API exposed directly from importing "pyodata.v2" or "pyodata.v4" Moreover, to remove cyclic imports: 1) Adapter function for build_entity_set(Credit to Jakub Filak) was added as well as class. 2) ODATAVersion was moved to separate file. 3) Redundant function schema_from_xml which required importing pyodata.v2 was removed. Used MetadataBuilder(xml, Config(ODataV2)) instead.
Configuration menu - View commit details
-
Copy full SHA for 37382de - Browse repository at this point
Copy the full SHA 37382deView commit details -
Fix parsing datetime containing timezone information for python 3.6
Required method for parsing datetime 'fromisoformat' was added in python version 3.7, thus backport of that method was added to the requirements list. Also '%z' directive was updated in python 3.7 to support timezone information in the "+xx:xx" or "Z" format. Hence, changes were made to allow compatibility of these notations in python 3.6 and lower. https://docs.python.org/3/library/datetime.html
Configuration menu - View commit details
-
Copy full SHA for 41d26fb - Browse repository at this point
Copy the full SHA 41d26fbView commit details -
Change default value of precision if non is provided in metadata
According to ODATA V4 specification when precision is not provided it defaults to infinity. ODATA V2 specification does not provide any information regarding the default value and ODATA V3 specification is unclear. Thus, following the ODATA V4 specification for all versions seams as the best idea. https://www.odata.org/documentation/odata-version-3-0/common-schema-definition-language-csdl/#csdl5.3.4 https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/csprd06/odata-csdl-xml-v4.01-csprd06.html#sec_Precision https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/csprd06/odata-csdl-xml-v4.01-csprd06.html#sec_Scale
Configuration menu - View commit details
-
Copy full SHA for de69e21 - Browse repository at this point
Copy the full SHA de69e21View commit details -
Add untracked files to the .gitignore
Folder .htmlcov is generated by the "make report-coverage-html"
Configuration menu - View commit details
-
Copy full SHA for 25a782d - Browse repository at this point
Copy the full SHA 25a782dView commit details -
Fix type hinting for ErrorPolicy's children
Type hint Type[ErrorPolicy] was not resoling correctly for its children.
Configuration menu - View commit details
-
Copy full SHA for 474cd3a - Browse repository at this point
Copy the full SHA 474cd3aView commit details -
Add permissive parsing for TypeDefinition
Before it was not possible to skip parsing of invalid TypeDefinition node.
Configuration menu - View commit details
-
Copy full SHA for 2d6ccaa - Browse repository at this point
Copy the full SHA 2d6ccaaView commit details -
Changes all manually raised exception to be child of PyODataException
This is to better handle permissive parsing as otherwise we could be catching unwanted exceptions. Test were updated to expect different exceptions.
Configuration menu - View commit details
-
Copy full SHA for 961c950 - Browse repository at this point
Copy the full SHA 961c950View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9837b3a - Browse repository at this point
Copy the full SHA 9837b3aView commit details
Commits on Jan 2, 2020
-
Change parsing of path values for navigation property bindings
Target Path can be (and is) bit more complex than just namespace and target name http://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_IdentifierandPathValues
Configuration menu - View commit details
-
Copy full SHA for 75100cb - Browse repository at this point
Copy the full SHA 75100cbView commit details
Commits on Jan 3, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b6d1081 - Browse repository at this point
Copy the full SHA b6d1081View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e0d451 - Browse repository at this point
Copy the full SHA 2e0d451View commit details
Commits on Apr 17, 2020
-
Add type annotations to the majority of variables and functions in Se…
…rvice V2 Before developing the Service V4 I wanted to fully understand how V2 works, however without data types it was nearly impossible to grasp the meaning of the code. Hence, this commit.
Configuration menu - View commit details
-
Copy full SHA for 7fba358 - Browse repository at this point
Copy the full SHA 7fba358View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06320bf - Browse repository at this point
Copy the full SHA 06320bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for f160c93 - Browse repository at this point
Copy the full SHA f160c93View commit details
Commits on Apr 24, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 17f4834 - Browse repository at this point
Copy the full SHA 17f4834View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d0193d - Browse repository at this point
Copy the full SHA 1d0193dView commit details
Commits on May 1, 2020
-
Configuration menu - View commit details
-
Copy full SHA for bdd010c - Browse repository at this point
Copy the full SHA bdd010cView commit details
Commits on Jun 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 29a71bf - Browse repository at this point
Copy the full SHA 29a71bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for b3e033b - Browse repository at this point
Copy the full SHA b3e033bView commit details
Commits on Jun 22, 2020
-
Add optional dependency into extras_require is setup.py.
It was already included in the file optional-requirements.txt but it was missing from setup.py, which cased inconsistency.
Configuration menu - View commit details
-
Copy full SHA for 9638dfe - Browse repository at this point
Copy the full SHA 9638dfeView commit details -
The error message should never be thrown away.
Configuration menu - View commit details
-
Copy full SHA for 005854c - Browse repository at this point
Copy the full SHA 005854cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ef4cf5 - Browse repository at this point
Copy the full SHA 9ef4cf5View commit details -
Configuration menu - View commit details
-
Copy full SHA for fab1712 - Browse repository at this point
Copy the full SHA fab1712View commit details -
Configuration menu - View commit details
-
Copy full SHA for d9348cd - Browse repository at this point
Copy the full SHA d9348cdView commit details