python-midas 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-midas
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Python client library for the California Energy Commission MIDAS API
5
5
  Project-URL: Homepage, https://grid-coordination.energy
6
6
  Project-URL: Repository, https://github.com/grid-coordination/python-midas
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-midas"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Python client library for the California Energy Commission MIDAS API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -135,7 +135,7 @@ class ValueData(MIDASBase):
135
135
  class RateInfo(MIDASBase):
136
136
  """Rate information and associated time-series values for a single RIN."""
137
137
 
138
- id: str
138
+ id: str | None = None
139
139
  system_time: pendulum.DateTime | None = None
140
140
  name: str | None = None
141
141
  type: RateType | str | None = None
@@ -158,7 +158,7 @@ class RateInfo(MIDASBase):
158
158
  values = [ValueData.from_raw(v) for v in vi] if vi else []
159
159
 
160
160
  inst = cls(
161
- id=raw["RateID"],
161
+ id=raw.get("RateID"),
162
162
  system_time=_parse_datetime(raw.get("SystemTime_UTC")),
163
163
  name=raw.get("RateName"),
164
164
  type=_parse_rate_type(raw.get("RateType")),
@@ -153,7 +153,8 @@ class TestRateValues:
153
153
  def test_realtime_query(self, client: MIDASClient):
154
154
  rate = client.rate_values("USCA-TSTS-TTOU-TEST", query_type="realtime")
155
155
  assert isinstance(rate, RateInfo)
156
- assert rate.id == "USCA-TSTS-TTOU-TEST"
156
+ # Realtime may return all-null fields if no realtime data exists
157
+ assert rate.id is None or rate.id == "USCA-TSTS-TTOU-TEST"
157
158
 
158
159
 
159
160
  # -- Flex Alert --
File without changes
File without changes
File without changes