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

.parts not always returning parts #1103

Closed
christoph-blessing opened this issue Jul 24, 2023 · 2 comments · Fixed by #1184
Closed

.parts not always returning parts #1103

christoph-blessing opened this issue Jul 24, 2023 · 2 comments · Fixed by #1184
Assignees
Labels

Comments

@christoph-blessing
Copy link

Bug Report

Description

Sometimes the .parts property on tables returns an empty list even if the table has parts.

    @schema
    class MyTable(dj.Manual):
        definition = """
        a: int
        ---
        b: int
        """

        class MyFirstPart(dj.Part):
            definition = """
            -> master       
            ---
            c: int
            """

        class MySecondPart(dj.Part):
            definition = """
            -> master       
            ---
            d: int
            """

    # MyTable().connection.dependencies.load()  # Uncommenting this fixes the problem
    assert MyTable().parts(as_objects=True) is []  # Should error but doesn't

Reproducibility

  • LINUX
  • Python 3.8
  • DataJoint Version 0.12.9
@kabilar
Copy link
Contributor

kabilar commented Jul 24, 2023

Thanks for the report @cblessing24. I was able to replicate this issue in DataJoint Python version 0.14.1.

@dimitri-yatsenko Would you suggest that I add the following line to the parts method? Or is there a different issue going on? Thanks.

self.connection.dependencies.load() 

@dimitri-yatsenko dimitri-yatsenko self-assigned this Jul 24, 2023
@dimitri-yatsenko
Copy link
Member

looking into this. Yes it appears that the function assumes that the dependencies have been loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants