OpenFn / OpenFn/adaptors

Collections: add an init or default value

Open
#866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevX Needs Priority
Dominant language
JavaScript
Stars
24
Forks
41
Avg merge
3d 13h
Merged PRs (30d)
12

Description

When getting a single value from collections, it would be nice for the adaptor to provide a default value if it doesn't exist

This is really useful for mappings, because it'll return an empty object instead of undefined, and save downstream errors

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the collection adaptor implementation and the code that retrieves a single value, then inspect existing tests for missing collection values. Done means the supported collection lookup can return the requested default for absent values, with tests covering the mapping case described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.