use duckdb
Browse files
app.py
CHANGED
@@ -40,18 +40,17 @@ def get_last_two_months_data():
|
|
40 |
FROM read_parquet('./data/all_trades_profitability.parquet')
|
41 |
WHERE creation_timestamp >= '{two_months_ago}'
|
42 |
"""
|
43 |
-
|
44 |
-
df1 = con.execute(query1).fetchdf()
|
45 |
df2 = con.execute(query2).fetchdf()
|
|
|
|
|
|
|
46 |
con.close()
|
47 |
return df1, df2
|
48 |
|
49 |
def prepare_data():
|
50 |
tools_df, trades_df = get_last_two_months_data()
|
51 |
|
52 |
-
# get current month
|
53 |
-
current_month = datetime.now().strftime("%Y-%m")
|
54 |
-
|
55 |
tools_df['request_time'] = pd.to_datetime(tools_df['request_time'])
|
56 |
trades_df['creation_timestamp'] = pd.to_datetime(trades_df['creation_timestamp'])
|
57 |
|
|
|
40 |
FROM read_parquet('./data/all_trades_profitability.parquet')
|
41 |
WHERE creation_timestamp >= '{two_months_ago}'
|
42 |
"""
|
43 |
+
print("here")
|
|
|
44 |
df2 = con.execute(query2).fetchdf()
|
45 |
+
print("here2")
|
46 |
+
df1 = con.execute(query1).fetchdf()
|
47 |
+
print("here3")
|
48 |
con.close()
|
49 |
return df1, df2
|
50 |
|
51 |
def prepare_data():
|
52 |
tools_df, trades_df = get_last_two_months_data()
|
53 |
|
|
|
|
|
|
|
54 |
tools_df['request_time'] = pd.to_datetime(tools_df['request_time'])
|
55 |
trades_df['creation_timestamp'] = pd.to_datetime(trades_df['creation_timestamp'])
|
56 |
|