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

Fix bugs in loading code from yaml #2705

Merged
merged 5 commits into from
Jun 24, 2022
Merged

Fix bugs in loading code from yaml #2705

merged 5 commits into from
Jun 24, 2022

Conversation

masci
Copy link
Contributor

@masci masci commented Jun 22, 2022

Related Issue(s): no issue, addressing failing tests on master

Proposed changes:

  • Stop relying on .endswith to determine if the instance is a leaf of the hierarchy tree. That check would mistakenly consider BaseElasticsearchDocumentstore.__init__ be the same as ElasticsearchDocumentstore.__init__. We now manipulate and compare the actual tokens composing the fully qualified name of a __init__ method.
  • Do not store constructor's parameters for the ancestors of a node instance we want to save/load. This was supposed to fail but thanks to the bug from the point above continued working
  • Remove the function _get_signature that was used to recursively collect all the params for all the constructors calls chain, the code isn't used anymore.

Pre-flight checklist

@masci masci requested review from ZanSara and tstadel and removed request for ZanSara and tstadel June 22, 2022 14:32
@masci masci marked this pull request as draft June 22, 2022 14:45
@tstadel
Copy link
Member

tstadel commented Jun 22, 2022

@masci Nice catch regarding the .endswith bug. Once the tests run through I'll approve.

@tstadel
Copy link
Member

tstadel commented Jun 22, 2022

@masci btw why did the md file of this tutorial get updated? Was there a merge before without running the Code & Documentation Updates job correctly?

@masci
Copy link
Contributor Author

masci commented Jun 22, 2022

@masci btw why did the md file of this tutorial get updated? Was there a merge before without running the Code & Documentation Updates job correctly?

I have no idea but I'm not very happy about the bot cluttering my PR :/

@ZanSara
Copy link
Contributor

ZanSara commented Jun 22, 2022

Weird! The changes come from this PR probably, where it seems like the bot was working fine... We should really do something about this 😅

@ZanSara
Copy link
Contributor

ZanSara commented Jun 23, 2022

Please merge master after we merge in #2714, so the bot will stop spamming 😅

@masci masci force-pushed the massi/fix-code-to-yaml branch from 719b219 to 304d9e6 Compare June 23, 2022 12:38
@ZanSara ZanSara marked this pull request as ready for review June 24, 2022 09:05
@masci masci force-pushed the massi/fix-code-to-yaml branch 2 times, most recently from 0784a3b to 3b29218 Compare June 24, 2022 10:30
@masci masci force-pushed the massi/fix-code-to-yaml branch from 3b29218 to 4fa12d7 Compare June 24, 2022 11:35
@masci masci added type:bug Something isn't working topic:document_store labels Jun 24, 2022
Copy link
Member

@tstadel tstadel left a comment

Choose a reason for hiding this comment

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

LGTM!

@masci masci merged commit 3207f37 into master Jun 24, 2022
@masci masci deleted the massi/fix-code-to-yaml branch June 24, 2022 12:52
Krak91 pushed a commit to Krak91/haystack that referenced this pull request Jul 26, 2022
* fix bug in loading code from yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:document_store type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants