Skip to content

IMPR: Documentation for populate generator #1246

Open
@CBroz1

Description

@CBroz1

Improvement Request

Problem

#1204 added the ability to delay the transaction within a populate call until needed, but did not provide instructions/documentation on proper use of this feature.

Does it require two yields? Before and after the inserts, but what should I yield to preserve referential integrity?

class MyTable(dj.Computed):
    ...
    def make(self, key):
        ret = some_processing(key)
        yield key # ?
        self.insert1(ret)
        yield key # ?

In an initial implementation attempt, I saw a StopIteration error with only one yield.

Requirements

A description of how to implement/benefit from this feature

Related Errors

Please include steps to reproduce provided errors as follows:

  • OS Linux
  • Python Version: 3.9.18
  • MySQL Version: 8.0.34
  • MySQL Deployment Strategy: local-docker
  • DataJoint Version: 0.14.4
  • Minimum number of steps to reliably reproduce the issue: n/a
  • Complete error stack as a result of evaluating the above steps: n/a

Screenshots

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new improvementstriageIndicates issues, pull requests, or discussions need to be reviewed for the first time

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions