Skip to content

Improve @transform macro to handle obj.field expressions #506

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

Closed
juliohm opened this issue Jan 24, 2025 · 0 comments · Fixed by JuliaEarth/GeoTables.jl#140
Closed

Improve @transform macro to handle obj.field expressions #506

juliohm opened this issue Jan 24, 2025 · 0 comments · Fixed by JuliaEarth/GeoTables.jl#140

Comments

@juliohm
Copy link
Member

juliohm commented Jan 24, 2025

Currently, the following code doesn't work:

@transform(geotable, :column = coords(:geometry).x < 100km)

The workaround consists of defining the function outside the macro:

fun(point) = coords(point).x < 100km

@transform(geotable, :column = fun(:geometry))

Basically, the expression obj.field is converted to obj.:field and incorrectly interpreted as a column of the geotable.

We need to handle this special case like other packages do (e.g., DataFramesMeta.jl)

@juliohm juliohm changed the title Improve @transform macro to handle arbitrary expressions Improve @transform macro to handle obj.field expressions Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant