Skip to content

Conversation

@ma1jmk
Copy link

@ma1jmk ma1jmk commented Sep 26, 2025

Pull Request

Description

Fixes #64

Move the assignment outside the if statement to ensure change_to_dataframe is assigned even if query_params is empty.

Passing an empty list into the method self.format_to_dataframe(query_params) is fine.

How Has This Been Tested?

import elexonpy.api as elex
unit_data = elex.ReferenceApi().reference_bmunits_all_get()

# test endpoint with non-empty query_params
df = elex.DemandApi().demand_outturn_get(settlement_date_from='2025-09-01', settlement_date_to='2025-09-19', format='dataframe')
  • [ - ] Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Doesn't affect data processing

  • Yes

Checklist:

  • [- ] My code follows OCF's coding style guidelines
  • [- ] I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • [- ] I have checked my code and corrected any misspellings

ensure change_to_dataframe is assigned even if query_params is empty
@peterdudfield
Copy link
Contributor

peterdudfield commented Sep 26, 2025

Do all other tests pass? Sorry I havent set the CI to work on external PR yet

Update, got the CI running now

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.

ReferenceApi().reference_bmunits_all_get() doesn't work

2 participants