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

Keyed subset of Date to character should "just work" #3506

Open
MichaelChirico opened this issue Apr 15, 2019 · 1 comment
Open

Keyed subset of Date to character should "just work" #3506

MichaelChirico opened this issue Apr 15, 2019 · 1 comment
Labels
idate/itime joins Use label:"non-equi joins" for rolling, overlapping, and non-equi joins

Comments

@MichaelChirico
Copy link
Member

DT = data.table(d = as.Date('2019-01-01'), key = 'd')

# fails since d is actually numeric
DT[.('2019-01-01')]

# this works since R coerces type for ==
DT[d == '2019-01-01']

Since we're already used to == implicitly coercing dates-as-strings to dates, I think there's reasonable expectation that join subsets would work similarly.

Logic is: if x's join key inherits from Date & i's join key is character, try as.IDate.

Type laxness presents a weird edge case -- what if x has .Date(0.1), should we round it first?

@MichaelChirico
Copy link
Member Author

MichaelChirico commented May 22, 2019

@mattdowle maybe take a look at this one while #2734 is still fresh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idate/itime joins Use label:"non-equi joins" for rolling, overlapping, and non-equi joins
Projects
None yet
Development

No branches or pull requests

1 participant