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

Make RatesReader return a datetime object rather than an int #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alisonspencer
Copy link

For consistency with the MetricsReader, RatesReader should return HourlyRate objects that contain a timestamp for the start date, rather than an int that must then be converted.

  • Rename the original HourlyRate dataclass that expects an int to HistoricalHourlyRate (analogous to HistoricalValues for MetricsReader)
  • Create a new HourlyRate dataclass that expects a datetime object for the 'start' parameter.
  • Update RatesReader to unpack the returned values from the HourlyRate object and convert the timestamp using datetime.fromtimestamp within the new data class definition

…rlyRate objects that contain a timestamp for the start date, rather than an int.

- Update the HourlyRate dataclass to expect a datetime object for the 'start' parameter.
- Update RatesReader to unpack the returned values from the old HourlyRate object, get the timestamp using datetime.fromtimestamp, then return the new object
…s used when pulling the data and expect start datetimes coded as `int`; HourlyRate class is used when unpacking the data via RatesReader and expect start datetimes as datetime objects
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