From 4b5f6ab85b58e90a0839bb89855f7dab7244f62d Mon Sep 17 00:00:00 2001 From: lelo Date: Wed, 18 Jun 2025 13:02:36 +0200 Subject: [PATCH] debug outputs --- .gitignore | 2 ++ app/app.py | 10 ++++++---- app/templates/index.html | 2 +- app/requirements.txt => requirements.txt | 0 4 files changed, 9 insertions(+), 5 deletions(-) rename app/requirements.txt => requirements.txt (100%) diff --git a/.gitignore b/.gitignore index 92b7d73..9f6ab2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ app/__pycache__/ app/.flask_session/ +.flask_session/ +venv/ .env diff --git a/app/app.py b/app/app.py index 58414f2..0ac0a4a 100644 --- a/app/app.py +++ b/app/app.py @@ -27,7 +27,7 @@ def get_dataframe(key): return df -def get_merged_df(table_name): +def get_merged_df(table_name): # return table_name: str """ Return a DataFrame for the given table_name based on Stripe and Raisenow inputs, enforcing strict one-to-one matching with: @@ -36,7 +36,7 @@ def get_merged_df(table_name): - no pandas merge suffixes at all - all original columns (including Raisenow's norm_zweck) preserved """ - + print('calculated DataFrame') # --- load & normalize Stripe --- stripe_import = get_dataframe('stripe_import') @@ -311,10 +311,12 @@ def upload(): return jsonify({'error': 'No files uploaded'}), 400 for f in files: + print('uploading file:', f.filename) raw = ( pd.read_csv(f) if f.filename.lower().endswith('.csv') else pd.read_excel(f) ) raw = raw.dropna(how='all').dropna(axis=1, how='all') + print('number of rows:', len(raw)) raw = raw.astype(object).replace({np.nan: None}) cols = list(raw.columns) if cols[:len(STRIPE_STARTING_COLS)] == STRIPE_STARTING_COLS: @@ -339,9 +341,9 @@ def upload(): @app.route('/get_table') def get_table(): table = request.args.get('table') - + print('get_table:', table) df = get_merged_df(table) - + print('number of rows:', len(df)) df = df.astype(object).where(pd.notnull(df), None) return jsonify({ 'columns': list(df.columns), diff --git a/app/templates/index.html b/app/templates/index.html index 5647048..d91d2ba 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -45,7 +45,7 @@