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

Change the way parent_key value is assigned #153

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

bilalebi
Copy link
Contributor

JIRA Ticket

https://www.ebi.ac.uk/panda/jira/browse/EA-1240

Changes

Example query

query pig_query {
  genomes(by_keyword: { common_name: "pig" }) {
    assembly_accession
    dataset {
      dataset_id
      dataset_type
      name
      release
      release_date
      release_type
      source
      type
      version
    }
    genome_id
    genome_tag
    is_reference
    parlance_name
    release_date
    release_number
    scientific_name
    taxon_id
    tol_id
    assembly {
      accession_id
      accessioning_body
      assembly_id
      default
      name
      organism {
        is_reference_organism
        scientific_name
        scientific_parlance_name
        assemblies {
          organism {
            assemblies {
              tolid
            }
          }
        }
      }
    }
  }
}

This query fetches many assemblies from both 110.2 and 110.2 releases.

From dict.setdefault docs:

If key is in the dictionary, return its value. If not, insert key with a value of default and return default. default defaults to None.

In our case, info.context[parent_key] was already set in the previous loop executions (e.g pointing to release 110.1 collection), which means info.context.setdefault(parent_key, conn) will be ignored, we need to update it if the release number changes

@bilalebi bilalebi merged commit b011cf1 into develop Aug 21, 2024
1 check passed
@bilalebi bilalebi deleted the bugfix/fix_context branch August 21, 2024 11:57
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.

2 participants