Re: How to merge datasets?

2021-12-13 Thread Jeremy Evans
On Mon, Dec 13, 2021 at 5:58 AM Tiago Cardoso wrote: > Hi, > > I'd like to know if there's a "public API" way of merging two datasets. > Something like, having the following: > > ``` > ds1 = db[table1].where(a: 1) > ds2 = db[table2].where(b: 2) > > # I'd like > ds1.merge(ds2) #=> would merge as

How to merge datasets?

2021-12-13 Thread Tiago Cardoso
Hi, I'd like to know if there's a "public API" way of merging two datasets. Something like, having the following: ``` ds1 = db[table1].where(a: 1) ds2 = db[table2].where(b: 2) # I'd like ds1.merge(ds2) #=> would merge as where(a: 1, b: 2) # I'm working around it by: ds1.where(ds2.opts[:where])

Re: How to merge datasets?

2021-12-13 Thread Tiago Cardoso
.intersect is definitely not covering my use-case. I'd be for a simple Dataset#merge_where, but as you said, it's relatively simple to do it. My only concerns would be if messing with Dataset#opts would be considered implementation detail and private-ish API. If I can rely on it working

Re: How to merge datasets?

2021-12-13 Thread Jeremy Evans
On Mon, Dec 13, 2021 at 9:03 AM Tiago Cardoso wrote: > .intersect is definitely not covering my use-case. > Could you explain why? For the example you gave, results should be identical. > I'd be for a simple Dataset#merge_where, but as you said, it's relatively > simple to do it. My only

Re: How to merge datasets?

2021-12-13 Thread Tiago Cardoso
A segunda-feira, 13 de dezembro de 2021 à(s) 18:12:19 UTC, Jeremy Evans escreveu: > On Mon, Dec 13, 2021 at 9:03 AM Tiago Cardoso > wrote: > >> .intersect is definitely not covering my use-case. >> > > Could you explain why? For the example you gave, results should be > identical. > The

Re: How to merge datasets?

2021-12-13 Thread Jeremy Evans
On Mon, Dec 13, 2021 at 10:29 AM Tiago Cardoso wrote: > A segunda-feira, 13 de dezembro de 2021 à(s) 18:12:19 UTC, Jeremy Evans > escreveu: > >> On Mon, Dec 13, 2021 at 9:03 AM Tiago Cardoso >> wrote: >> >>> .intersect is definitely not covering my use-case. >>> >> >> Could you explain why?