hazelcast-python-client icon indicating copy to clipboard operation
hazelcast-python-client copied to clipboard

Add Missing Portable Read/Write Functions [API-1014]

Open mehmettokgoz opened this issue 2 years ago • 1 comments

Currently, the read and write functions for decimal, time, date, timestamp, timestamp_with_timezone types are missing for Portable serialization. This PR implements them and adds related tests.

Changes

  • Functions are introduced to API in api.py
  • Field type numbers are added for the class definition following the sequential order.
  • Implemented nullable read and write functions for these types, porting the Java client functions: DefaultPortableWriter.java#L198 and DefaultPortableReader.java#L141.
  • Since the R/W functions are not the same for Portable and other serialization methods, special ones are implemented for Portable using portable infix in function names. (writer.py#L250 and reader.py#L360)
  • New types are included in Portable unit tests.
  • No documentation change is required.

mehmettokgoz avatar Sep 01 '22 12:09 mehmettokgoz

Codecov Report

Merging #569 (d641840) into master (06a48e8) will increase coverage by 0.03%. The diff coverage is 98.69%.

@@            Coverage Diff             @@
##           master     #569      +/-   ##
==========================================
+ Coverage   96.47%   96.50%   +0.03%     
==========================================
  Files         355      348       -7     
  Lines       20351    19794     -557     
==========================================
- Hits        19633    19103     -530     
+ Misses        718      691      -27     
Impacted Files Coverage Δ
hazelcast/serialization/portable/writer.py 93.39% <95.23%> (+0.67%) :arrow_up:
hazelcast/serialization/api.py 100.00% <100.00%> (ø)
hazelcast/serialization/portable/classdef.py 92.00% <100.00%> (+1.72%) :arrow_up:
hazelcast/serialization/portable/reader.py 95.29% <100.00%> (+0.64%) :arrow_up:
hazelcast/proxy/map.py 97.82% <0.00%> (-0.43%) :arrow_down:
hazelcast/util.py
hazelcast/proxy/cp/__init__.py
hazelcast/client.py
hazelcast/proxy/__init__.py
hazelcast/compact.py
... and 7 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Sep 22 '22 11:09 codecov-commenter