Skip to content

Fix: missing 'unit_code' argument in AsyncOEClient get_facility_data method#27

Open
emvollmer wants to merge 1 commit intoopennem:mainfrom
emvollmer:fix/async_get_facility_data
Open

Fix: missing 'unit_code' argument in AsyncOEClient get_facility_data method#27
emvollmer wants to merge 1 commit intoopennem:mainfrom
emvollmer:fix/async_get_facility_data

Conversation

@emvollmer
Copy link
Copy Markdown

Hello!

I noticed the AsyncOEClient.get_facility_data class method was missing the unit_code argument. Was going to create an issue but realised it would be just as quick to fix it myself and create a PR :)

Problem

Currently, the synchronous OEClient supports querying by unit_code, but the asynchronous implementation was missing this argument in its method signature, making it impossible to query specific units without hitting a 404 error when the unit code differs from the facility code.

Solution

Added the unit_code argument to AsyncOEClient.get_facility_data and updated the method where necessary to account for this change (i.e. made the facility_code optional to allow for sole use of unit_code). The changes align with the synchronous implementation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

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