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

chore: update query #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: update query #2

wants to merge 1 commit into from

Conversation

NowNewNao
Copy link

@NowNewNao NowNewNao commented Jan 26, 2023

Summary

This PR updates example of halfHourlyReadings query, which was updated on the prod.

  • costEstimate added as return value
  • productCode is required as one of the query variables
GET_HH_BODY = """
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime, $productCode: String!) {
  account(accountNumber: $accountNumber) {
    properties {
      electricitySupplyPoints {
        halfHourlyReadings(fromDatetime: $fromDatetime, toDatetime: $toDatetime, productCode: $productCode) {
          startAt
          endAt
          version
          value
          costEstimate
        }
      }
    }
  }
}
"""

🤚 Need help

I updated body in octopus.py, but I assume I also need to maintain other place as well such as something like setting def get_product_code(???) -> str: 🙇

@@ -79,15 +79,16 @@ def get_account_number(token: str) -> str:


GET_HH_BODY = """
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime) {
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime, $productCode: String!) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You'd also need to update the place where this is used I think - down on line 117

Copy link
Author

Choose a reason for hiding this comment

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

@FraserTooth did you mean around here?
Screenshot 2023-01-26 at 9 49 13

Copy link
Collaborator

Choose a reason for hiding this comment

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

@NowNewNao NowNewNao force-pushed the update-query-variables branch from b51351c to 6fdcb42 Compare January 26, 2023 00:52
) -> List[HHReading]:

variables = {
"accountNumber": account_number,
"fromDatetime": start_at.isoformat(),
"productCode": product_code,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bit - you found it tho 👍

@FraserTooth
Copy link
Collaborator

If you wanted to use costEstimate you'd have to update this bit with a new line:
image
And also update that dataclass's type with what cost estimate is (probably number?)

@jgasteiz jgasteiz removed their request for review August 20, 2024 07:00
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