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

Downgrading xmltodict to 0.12.0 makes the script slow #203

Open
SureshRIS opened this issue Mar 13, 2024 · 6 comments
Open

Downgrading xmltodict to 0.12.0 makes the script slow #203

SureshRIS opened this issue Mar 13, 2024 · 6 comments

Comments

@SureshRIS
Copy link

SureshRIS commented Mar 13, 2024

I face issue similar to issue #177 and i saw solutions provided with PR #178 and i tried this way (updating _init.py) and it makes fetching WI's very slow
As well as i tried downgrading my xmltodict to <=0.12.0 but this also makes fetching WI's very slow

Is there any alternative solution for this ? I would like to get attributes owned by or plannedFor but i only get them as a link like : https://rb-alm.com/ccm/oslc/workflows/_qi848CJaEeSy9NmiE0zU4Q/states/com.bosch.rtc.configuration.workflow.workflowdefinition.review/com.bosch.rtc.configuration.workflow.workflowdefinition.review.state.s1

@SureshRIS
Copy link
Author

@dixudx or @gpongelli any other ideas how to solve it. would be helpful

@dixudx
Copy link
Owner

dixudx commented Mar 13, 2024

@SureshRIS Please try to install rtcclient with version 0.9.0.

@SureshRIS
Copy link
Author

SureshRIS commented Mar 13, 2024

@dixudx I installed rtcclient with 0.9.0 and then i downgraded the xmltodict to 0.12.0 and i got the following warning/error while downgrading

rtcclient 0.9.0 has requirement xmltodict<0.14.0,>=0.13.0, but you'll have xmltodict 0.12.0 which is incompatible. Installing collected packages: xmltodict Found existing installation: xmltodict 0.13.0 Uninstalling xmltodict-0.13.0: Successfully uninstalled xmltodict-0.13.0 Successfully installed xmltodict-0.12.0

But still even now with xmltodict-0.12.0 , the script is very slow.

Thanks a lot for commenting or supporting @dixudx

@dixudx
Copy link
Owner

dixudx commented Mar 13, 2024

@SureshRIS I think there is no need to downgrade xmltodict to 0.12.0, which is a buggy version. That's why we pin xmltodict to 0.13.0.

@SureshRIS
Copy link
Author

SureshRIS commented Mar 13, 2024

Okay, i also tried the possibility with rtcclient with 0.9.0 and xmltodict to 0.13.0 , but still i only get the RDF links (when accessing any attribute)

{'@Rdf:resource': 'https://rb-almcom/jts/users/AEJ34JR'} -> for example

@dixudx
Copy link
Owner

dixudx commented Mar 13, 2024

still i only get the RDF links (when accessing any attribute)

Then there is no need to worry about the xmltodict version. Please go ahead on using rtcclient with 0.9.0.

{'@Rdf:resource': 'https://rb-almcom/jts/users/AEJ34JR'} -> for example

From above resource link, it seems to be a user link.
@SureshRIS You can try to debug below function to see what is missing or incompatible in your rtc environment.

rtcclient/rtcclient/base.py

Lines 315 to 344 in 832019e

def __process_items(self, item):
"""Process a single work item element"""
key, value = item
if key.startswith("@"):
# be compatible with IncludedInBuild
if "@oslc_cm:label" != key:
return None
attr = key.split(":")[-1].replace("-", "_")
attr_list = attr.split(".")
# user want to ignore long attributes
if self.skip_full_attributes and len(attr_list) > 1:
# attr = "_".join([attr_list[-2],
# attr_list[-1]])
return None
if isinstance(value, OrderedDict):
value_text = value.get("#text")
if value_text is not None:
value = value_text
else:
# request detailed info using rdf:resource
value = list(value.values())[0]
try:
value = self.__get_rdf_resource_title(value)
except (exception.RTCException, Exception):
self.log.error("Unable to handle %s", value)
return key, attr, value

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

No branches or pull requests

2 participants