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

qjoin - join - a default value replaces None for joins that fail #8

Open
FabienArcellier opened this issue Aug 27, 2023 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@FabienArcellier
Copy link
Owner

When a join fails, the element of the join in the final collection is None. It is possible to use another value by specifying the default parameter of the join function.

default_spacecraft_mission = {'name': None, 'mission_type': None, 'launch_date': None}

global_space_crafts = qjoin.on(spacecrafts) \
                           .join(spacecrafts_mission_infos, left='name', right='mission', default={) \
                           .all()

for spacecraft, spacecraft_mission_infos in global_space_crafts:
    print(spacecraft['name'])

documentation

  • write the section Join use default value when the join fails in User guide > Join
@FabienArcellier FabienArcellier added the enhancement New feature or request label Aug 27, 2023
@FabienArcellier FabienArcellier added this to the 0.2.0 milestone Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant