Skip to content

Fix python get_tlm_values and queries with all None - #3861

Open
ryanmelt wants to merge 1 commit into
mainfrom
fix_python_get_tlm_values
Open

Fix python get_tlm_values and queries with all None#3861
ryanmelt wants to merge 1 commit into
mainfrom
fix_python_get_tlm_values

Conversation

@ryanmelt

Copy link
Copy Markdown
Member

What changed

Update to python get_tlm_values to pass limits to the CvtModel to remove errors. Also adds missing tests.

Why it changed

Using get_tlm_values with a start_time was crashing

Testing strategy

Unit tests added

@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.61%. Comparing base (aa0c194) to head (4de537c).

Files with missing lines Patch % Lines
openc3/lib/openc3/utilities/questdb_client.rb 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3861      +/-   ##
==========================================
+ Coverage   79.58%   79.61%   +0.03%     
==========================================
  Files         901      901              
  Lines       68067    68084      +17     
  Branches     2633     2633              
==========================================
+ Hits        54171    54208      +37     
+ Misses      13222    13204      -18     
+ Partials      674      672       -2     
Flag Coverage Δ
frontend 66.41% <ø> (+0.04%) ⬆️
python 79.51% <ø> (+0.02%) ⬆️
ruby-api 82.62% <ø> (+0.14%) ⬆️
ruby-backend 85.17% <50.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

# If a start_time is passed we're doing a QuestDB lookup and directly return the results
# TODO: This currently does NOT support the override values
if start_time is not None:
return cls.tsdb_lookup(items, start_time=start_time, end_time=end_time)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to pass scope here!

# get_tlm_available returns None for items which don't exist and its result is
# passed directly here, so None is a placeholder which returns a None value
if item is None:
cvt_items.append([None, None, None, None, None])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match ruby's tlm_api.rb at line 335. I think this is correct and Ruby should be fixed. Note that tlm_api.rb 335 is currently a noop because line 344 over writes it each time. Add tests for Ruby and make it match implementation.

calculated_items = {}
needed_timestamps = {}
current_position = 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this method have any sharding logic? The Ruby version has db_shard_groups with a bunch of logic.

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.

2 participants