Combine callback functions check_item_type(s) and move to specs

Open
#912 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli, testing

Research direction

Compare the duplicate check_item_type and check_item_types callbacks in planet.cli.data and planet.cli.subscriptions, then inspect their tests and the existing planet.specs module. Determine whether one callback can cover both uses, move the callback implementation(s) to planet.specs, and update the Data and Subscriptions CLIs and callback tests. Done means the duplicate logic is reduced and the relevant tests pass.

Written by the indexing model from the issue text.

Description

CLI/SDK Interface proposal

In planet.cli.data and planet.cli.subscriptions, we have identical pairs of callback functions: check_item_type and check_item_types, which were temporarily introduced in https://github.com/planetlabs/planet-client-python/pull/905. These two functions are incredibly similar and we could probably be do with just one of them.

  1. Let's explore the possibility of removing one of the two callback functions in order to reduce complexity.
  2. Let's move these callback function(s) to planet.specs and update the Data and Subscriptions CLIs, the callback function(s) tests.
Dominant language
Python
Stars
299
Forks
100
Avg merge
7d 8h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

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.

More from planetlabs/planet-client-python

All issues in planetlabs/planet-client-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.