Skip to content
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

WIP: Support NGSI Structured Value also for Type different from StructuredValue (if they map to that value type) #132

Merged
merged 17 commits into from
Jan 25, 2019

Conversation

agaldemas
Copy link

to fix issue with PostalAddress #127 and #129
if attribute is a complex object of unknown type cast it to NGSI_STRUCTURED_VALUE, to store it as object in Crate
not finish, still miss the test of complex attribute, welcome hints on this and metadata handling

to fix issue with PostalAddress orchestracities#127 and orchestracities#129
if attribute is a complex object of unknown type cast it to NGSI_STRUCTURED_VALUE, to store it as object in Crate
not finish, still miss the test of complex attribute
@agaldemas
Copy link
Author

Hello here is the pull request, waiting for your advice for the complex attribute test

src/translators/crate.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chicco785 chicco785 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to me that current change will cast to structurevalue any not recognised attribute type

@chicco785 chicco785 changed the title Update crate.py WIP: Support NGSI Structure Value also for Type different from StructuredValue (if they map to that value type) Jan 11, 2019
@agaldemas agaldemas changed the title WIP: Support NGSI Structure Value also for Type different from StructuredValue (if they map to that value type) WIP: Support NGSI Structured Value also for Type different from StructuredValue (if they map to that value type) Jan 11, 2019
to test if an attribute value is a structured object
@chicco785
Copy link
Contributor

@agaldemas, fyi failure in the test is not related to your code, @taliaga what should we do about this painful geolocation issues?

@agaldemas
Copy link
Author

I should work on the PR, during this week.

@agaldemas
Copy link
Author

OK, guys, I managed to fix the last remaining issue (test_capitals)
only remains your failed test_entity_add_city_shape
note that I had to remove lower on attributes names/columns
#128 and #129 are OK now
ready for merge

@agaldemas
Copy link
Author

Rectification, I will restore the lower case for column names, it will be better for existing database, to avoid regression ;O)

@c0c0n3
Copy link
Member

c0c0n3 commented Jan 22, 2019

Hi guys, I've just realised that #136 overlaps with some of the work done here---namely quoting of identifiers. Merging is going to be a bit painful, but @taliaga and I will try to get it done. @agaldemas thank you so much for your contributions!!!

@agaldemas
Copy link
Author

You're welcome !

@c0c0n3 c0c0n3 changed the base branch from master to pr#132-integration January 25, 2019 17:38
@c0c0n3 c0c0n3 merged commit 93f60bd into orchestracities:pr#132-integration Jan 25, 2019
@c0c0n3 c0c0n3 mentioned this pull request Jan 25, 2019
@c0c0n3
Copy link
Member

c0c0n3 commented Jan 25, 2019

Merged into an integration branch so to be able to cherry pick only the fixes to #127 and #129 while discarding those to #128. Also moving the discussion over to #142.

@c0c0n3
Copy link
Member

c0c0n3 commented Jan 28, 2019

follow-up: see PR #142.

@c0c0n3 c0c0n3 mentioned this pull request Jan 29, 2019
c0c0n3 added a commit that referenced this pull request Jan 30, 2019
* Update crate.py

to fix issue with PostalAddress #127 and #129
if attribute is a complex object of unknown type cast it to NGSI_STRUCTURED_VALUE, to store it as object in Crate
not finish, still miss the test of complex attribute

* add function attrValIsStructured()

to test if an attribute value is a structured object

* first commit from local dev repo fix syntax error in new function attrValIsStructured

* added function to detect structured value & use it in  case of unknown NGSI type

* quote column names to allow "-" char in name

* quote of table and columns names in sql queries

* change funtion attrValIsStructured name to _attr_is_structured
add test function in test_crate.py: test_accept_unknown_ngsi_type

* added reference to issues in new functios
test_accept_unknown_ngsi_type
test_accept_special_chars

* fixed some code climate issues

* fixed fiware-service and fiware-servicepath header ( '-' was missing)

* quote table name in drop table queries

* still issue with drop table add quotes

* issue mkssing quote in _refresh function

* fix pb in test test_capitals ?

* fix pb in test test_capitals again

* fixed issues with columns containing capital characters
test_capitals works ok now
remove lower of attribute names to have correct metadata

* restore lowercase for columns names

* rolling back fiware header rename, see #148

* turn comment about empty attr into test case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants