You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from deephaven import read_csv
# read_csv will accept a url or a path to a local file
seattle_weather = read_csv("https://media.githubusercontent.com/media/deephaven/examples/main/GSOD/csv/seattle.csv")
from deephaven.time import year, TimeZone
from deephaven import agg
TZ_NY = TimeZone.NY
hi_lo_by_year = seattle_weather.view(formulas=["Year = (int)year(ObservationDate, TimeZone.NY)", "TemperatureF"])\
.where(filters=["Year >= 2000"])\
.agg_by([\
agg.avg(cols=["Avg_Temp = TemperatureF"]),\
agg.min_(cols=["Lo_Temp = TemperatureF"]),\
agg.max_(cols=["Hi_Temp = TemperatureF"])
],\
by=["Year"])
Running the above code causes an exception
Having trouble with the following expression:
Full expression : (int)year(ObservationDate, TimeZone.NY)
Expression having trouble : io.deephaven.engine.table.impl.lang.QueryLanguageParser$VisitArgs@43adc7c1
Exception message : Cannot resolve field name.
Expression : TimeZone.NY
Scope : TimeZone
Scope Type : io.deephaven.engine.util.PyCallableWrapper
Field Name : NY
The workaround is to assign the class attribute to a local variable first (TZ_NY in the code) and replace TimeZone.NY with it in the query string, but it is not natural and confusing to the users.
The text was updated successfully, but these errors were encountered:
Running the above code causes an exception
The workaround is to assign the class attribute to a local variable first (
TZ_NY
in the code) and replaceTimeZone.NY
with it in the query string, but it is not natural and confusing to the users.The text was updated successfully, but these errors were encountered: