4 ms·
This is awesome. Is there a way to get it to work with e.g. dataclasses-sql? I am thinking of something such as stuff: list[mydataclass] sql_val^ "select
by pizza 4y ago
This is awesome. Is there a way to get it to work with e.g. dataclasses-sql? I am thinking of something such as
stuff: list[mydataclass]
sql_val^ "select * from stuff where stuff.field = 2"
over any kind of 'fmappable' container; perhaps eg.
stuff: dict[int, mydataclass]
stuff2: dict[int, mydataclass]
sql_val^ "select (s2.val, s.key) from stuff as s, stuff2 as s2 where s.key > s2.key and s2.value != s.value)"
etc
- ekzhang 4y agoHm, you're currently able to do this through Pandas. stuff: list[mydataclass] stuff_df = pd.DataFrame(stuff) results = sql^ "SELECT * FROM stuff_df WHERE field = 2" My guess is that this would be a lot faster than dataclasses-sql due to less conversion overhead, but we'd have to benchmark it to be sure.
- pizza 4y agoAh interesting. I was thinking along the lines of if you wanted to, say, package up an algorithm as a class, make a ton of these classes/algorithms, and then affix them in a bunch of ways. E.g. "find the algorithms that take in data and spit out predictions, compose them with the algorithms that have a prediction_input field" etc.