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

Signal Documentation Coverage Endpoint #1584

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open

Conversation

nolangormley
Copy link
Contributor

@nolangormley nolangormley commented Jan 27, 2025

addresses issue(s) #1583

Summary:

Create a new endpoint that returns a list of signals when given a geo. There were other endpoints that did this in the past, but the tables they read from are no longer around in epi v4. Starting from scratch will be much quicker and rely less on legacy code.

Once this is merged, I will also make issues to delete the old coverage code so that we don't have duplicate endpoints.

Prerequisites:

  • Unless it is a documentation hotfix it should be merged against the dev branch
  • Branch is up-to-date with the branch to be merged with, i.e. dev
  • Build is successful
  • Code is cleaned up and formatted

@nolangormley
Copy link
Contributor Author

Proposed SQL for this endpoint

CREATE TABLE coverage_crossref (
    signal_key_id bigint NOT NULL,
    geo_key_id bigint NOT NULL,
    min_time_value int NOT NULL,
    max_time_value int NOT NULL
)
SELECT
    el.signal_key_id,
    el.geo_key_id,
    MIN(el.time_value) as min_time_value,
    MAX(el.time_value) as max_time_value
FROM epimetric_latest el
GROUP BY el.signal_key_id, el.geo_key_id;

CREATE INDEX coverage_crossref_signal_key_id ON coverage_crossref (signal_key_id);
CREATE INDEX coverage_crossref_geo_key_id ON coverage_crossref (geo_key_id);


CREATE VIEW coverage_crossref_v AS
SELECT
    sd.source,
    sd.signal,
    gd.geo_type,
    gd.geo_value,
    cc.min_time_value,
    cc.max_time_value
FROM coverage_crossref cc
JOIN signal_dim sd USING (signal_key_id)
JOIN geo_dim gd USING (geo_key_id)

@nolangormley nolangormley self-assigned this Jan 27, 2025
@nolangormley nolangormley changed the title first pass at coverage endpoint Signal Documentation Coverage Endpoint Jan 27, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@nolangormley nolangormley marked this pull request as ready for review January 29, 2025 21:17
@nolangormley
Copy link
Contributor Author

Sonar is failing on a security flaw around using HTTP instead of HTTPS, but it is for a test. This is how it's done in other tests too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant