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

NGSI-LD option="keyValues" does not always work #368

Open
djs0109 opened this issue Jan 7, 2025 · 0 comments
Open

NGSI-LD option="keyValues" does not always work #368

djs0109 opened this issue Jan 7, 2025 · 0 comments
Labels
bug Something isn't working NGSI-LD

Comments

@djs0109
Copy link
Contributor

djs0109 commented Jan 7, 2025

Describe the bug
It is reported that for get_entity_list if option="keyValues" is used, no entities can be returned

To Reproduce

from filip.clients.ngsi_ld.cb import ContextBrokerLDClient
from filip.models import FiwareLDHeader
from filip.models.ngsi_ld.context import ContextLDEntity, ActionTypeLD

attr = {"testtemperature": {"type": "Property", "value": 20.0}}
entity_list = [ContextLDEntity(
    id=f"urn:ngsi-ld:my:id{i}", type="MyType", **attr) for i in range(10)]


fiware_header = FiwareLDHeader(ngsild_tenant="test")
client = ContextBrokerLDClient(
    fiware_header=fiware_header, url="http://134.130.49.13:1027"
)

client.entity_batch_operation(entities=entity_list, action_type=ActionTypeLD.UPSERT)

entities_normal = client.get_entity_list()
entities_key_values = client.get_entity_list(options="keyValues")
entities_sys_attrs = client.get_entity_list(options="sysAttrs")

print("\nentities_normal", entities_normal)
print("\nentities_key_values", entities_key_values)
print("\nentities_sys_attrs", entities_sys_attrs)

client.entity_batch_operation(entities=entity_list, action_type=ActionTypeLD.DELETE)

entities_key_values is reported to be None sometimes. However, I cannot reproduce in my environment.

@djs0109 djs0109 added bug Something isn't working NGSI-LD labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NGSI-LD
Projects
None yet
Development

No branches or pull requests

1 participant