File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -232,17 +232,17 @@ def estimate_co2_emissions(
232
232
_co2_units = "kgCO2/kWh"
233
233
else :
234
234
self .check_refresh ()
235
+ # If no local data yet then return
236
+ if not (_country_codes := list (self ._local_data .keys ())):
237
+ self ._logger .warning (
238
+ "No CO2 emission data recorded as no CO2 intensity value "
239
+ "has been provided and there is no local intensity data available."
240
+ )
241
+ return
242
+
235
243
if self ._client :
236
244
_country_code = self ._client .country_code
237
245
else :
238
- # If no local data yet then return
239
- if not (_country_codes := list (self ._local_data .keys ())):
240
- self ._logger .warning (
241
- "No CO2 emission data recorded as no CO2 intensity value "
242
- "has been provided and there is no local intensity data available."
243
- )
244
- return
245
-
246
246
_country_code = _country_codes [0 ]
247
247
self ._logger .debug (
248
248
f"🗂️ Using data for region '{ _country_code } ' from local cache for offline estimation."
You can’t perform that action at this time.
0 commit comments