Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test: document empty input behavior in get_value_vars_from_user_vars#8031

Merged
ricardoV94 merged 3 commits intopymc-devs:mainfrom
jyotihotwani25:my-feature
Jan 6, 2026
Merged

test: document empty input behavior in get_value_vars_from_user_vars#8031
ricardoV94 merged 3 commits intopymc-devs:mainfrom
jyotihotwani25:my-feature

Conversation

@jyotihotwani25
Copy link
Contributor

Description

This PR adds a test documenting that get_value_vars_from_user_vars([], model) returns an empty list when given empty input.

The test reflects the current behavior and improves coverage for an edge case without changing any functionality.

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@ricardoV94
Copy link
Member

Why do you feel this is needed?

Copy link
Member

Choose a reason for hiding this comment

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

You can add it in the first block of checks from the first model. It doesn't need to be tested with an empty model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for adding this check is to explicitly document the current contract that empty input is a valid case and returns an empty list, rather than failing implicitly or raising an error. Without an explicit test, this behavior could
easily change unintentionally during refactors without being caught.

I agree that the behavior itself does not depend on model contents, and placing the assertion alongside the existing model1 checks makes the intent clearer. I’ve moved it there.

I’m still getting familiar with the PyMC codebase, if there are particular parts you’d recommend focusing on early when exploring the codebase, I’d appreciate any pointers.
Thanks for the review.

@ricardoV94 ricardoV94 added tests no releasenotes Skipped in automatic release notes generation labels Jan 6, 2026
@ricardoV94
Copy link
Member

ricardoV94 commented Jan 6, 2026

I'm approving this one @jyotihotwani25 , but I feel it's a code-change looking for a reason rather than the other way around. Python is loosely typed and any function that accepts/returns containers will have empty edge case. I don't believe we should test it all just "because". I suggest looking for code changes that are meaningful to the users for your next steps (if you so wish to proceed), or actual bug-fixes.

Rule-of-thumb: if there's no issue open for it, it's probably not a good first issue

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.45%. Comparing base (14057e6) to head (e22287c).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8031   +/-   ##
=======================================
  Coverage   91.44%   91.45%           
=======================================
  Files         116      116           
  Lines       18971    19025   +54     
=======================================
+ Hits        17348    17399   +51     
- Misses       1623     1626    +3     

see 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94 ricardoV94 merged commit a1a2833 into pymc-devs:main Jan 6, 2026
42 checks passed
@welcome
Copy link

welcome bot commented Jan 6, 2026

Congratulations Banner]
Congrats on merging your first pull request! 🎉 We here at PyMC are proud of you! 💖 Thank you so much for your contribution 🎁

@jyotihotwani25
Copy link
Contributor Author

Thanks for the approval and the feedback. I’ll focus future contributions on more clearly user-facing and impactful changes.
I Appreciate the guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no releasenotes Skipped in automatic release notes generation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments