astronomy-commons/hats-tap

Translate ADQL's `BETWEEN` to appropriate Python

Open

#17 opened on Dec 2, 2025

 (1 comment) (0 reactions) (0 assignees)Python (0 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1 star)
PR merge metrics
 (PR metrics pending)

Description

Feature request

SELECT * FROM ppdb.DiaObject WHERE r_psfFluxMean BETWEEN 1090.0 and 1100.0

can be translated to

compute(ppdb.query("1090.0 <= r_psfFluxMean <= 1100.0"))

or

ppdb.open_catalog(..., filters=[('r_psfFluxMean', '>=', 1090), ('r_psfFluxMean', '<=', 1100)])
compute(ppdb)

At present, the second version is what the translator supports, but the Python "between" operator could be used once we have implemented the ability to translate to .query(). In either case, the translator needs to attach logic to the BETWEEN event.

Before submitting Please check the following:

  • I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
  • I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
  • If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.

Contributor guide