From a181e411729eb9ae88e881855a285f3ab05b2d41 Mon Sep 17 00:00:00 2001 From: Jonas Linter <{email_address}> Date: Mon, 17 Nov 2025 22:01:35 +0100 Subject: [PATCH] The email validation is actually broken lol --- config/alpinebits.log | 50 +++++++++++++++++++ config/config.yaml | 2 +- sql_analysis.md | 17 +++++++ src/alpine_bits_python/alpine_bits_helpers.py | 4 +- 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/config/alpinebits.log b/config/alpinebits.log index 55088a2..dde1b65 100644 --- a/config/alpinebits.log +++ b/config/alpinebits.log @@ -1453663,3 +1453663,53 @@ WHERE alpinebits.conversions.pms_reservation_id = $1::VARCHAR] 2025-11-17 19:02:50 - alpine_bits_python.conversion_service - INFO - Matched conversion by advertising data (advertisingCampagne=PAZXh0bgNhZW0BMABhZGlkAaska1VJfPRzcnRjBmFwcF9pZA81NjcwNjczNDMzNT, hotel=39054_001) 2025-11-17 19:02:50 - alpine_bits_python.conversion_service - INFO - Matched conversion by advertising data (advertisingCampagne=PAZXh0bgNhZW0BMABhZGlkAastHvqMffRzcnRjBmFwcF9pZA81NjcwNjczNDMzNT, hotel=39054_001) 2025-11-17 19:02:50 - alpine_bits_python.api - INFO - Conversion processing complete for file.xml: {'total_reservations': 38200, 'deleted_reservations': 55, 'total_daily_sales': 454164, 'matched_to_reservation': 905, 'matched_to_customer': 905, 'matched_to_hashed_customer': 905, 'unmatched': 36353, 'errors': 0} +2025-11-17 21:05:29 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name gmail.come does not exist. +2025-11-17 21:05:29 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The part after the @-sign is not valid. It is not within a valid top-level domain. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name minder-tehnik.ch does not exist. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name gmx.dr does not exist. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name gmail.con does not exist. +2025-11-17 21:05:30 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name gmail.con does not exist. +2025-11-17 21:05:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name hormail.it does not exist. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: The domain name gmail.con does not exist. +2025-11-17 21:05:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: eleonorabagnolatti73@gmail.come -> The domain name gmail.come does not exist. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: colombo.carla.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: adam.@hotmail.it -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: vogel_marion@web.de1 -> The part after the @-sign is not valid. It is not within a valid top-level domain. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: info@minder-tehnik.ch -> The domain name minder-tehnik.ch does not exist. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: dilara.algan@gmx.dr -> The domain name gmx.dr does not exist. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: matildemerciai@gmail.con -> The domain name gmail.con does not exist. +2025-11-17 21:06:31 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: chimentomanuela.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: simo.@hotmail.it -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: silviadallapiazza@gmail.con -> The domain name gmail.con does not exist. +2025-11-17 21:06:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: fabiola.@hotmail.it -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:32 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: roberta.consoli.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: simonetta.@icloud.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: squartecchia.fabio.@hotmail.it -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: valentina_giannini92@hormail.it -> The domain name hormail.it does not exist. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: e.l.e.@hotmail.it -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: cristinamapelli.@outlook.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: alice.santi.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: alice.santi.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: sara.trovarelli@gmail.con -> The domain name gmail.con does not exist. +2025-11-17 21:06:33 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: ari.vinci.@gmail.com -> An email address cannot have a period immediately before the @-sign. +2025-11-17 21:14:03 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: eleonorabagnolatti73@gmail.come -> The domain name gmail.come does not exist. +2025-11-17 21:14:03 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: vogel_marion@web.de1 -> The part after the @-sign is not valid. It is not within a valid top-level domain. +2025-11-17 21:14:03 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: info@minder-tehnik.ch -> The domain name minder-tehnik.ch does not exist. +2025-11-17 21:14:03 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: dilara.algan@gmx.dr -> The domain name gmx.dr does not exist. +2025-11-17 21:14:04 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: matildemerciai@gmail.con -> The domain name gmail.con does not exist. +2025-11-17 21:14:04 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: silviadallapiazza@gmail.con -> The domain name gmail.con does not exist. +2025-11-17 21:14:05 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: valentina_giannini92@hormail.it -> The domain name hormail.it does not exist. +2025-11-17 21:14:05 - alpine_bits_python.alpine_bits_helpers - WARNING - invalid email address: sara.trovarelli@gmail.con -> The domain name gmail.con does not exist. diff --git a/config/config.yaml b/config/config.yaml index 727bfed..77098f8 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -8,7 +8,7 @@ database: # Use annotatedyaml for secrets and environment-specific overrides logger: - level: "INFO" # Set to DEBUG for more verbose output + level: "WARNING" # Set to DEBUG for more verbose output file: "config/alpinebits.log" # Log file path, or null for console only server: diff --git a/sql_analysis.md b/sql_analysis.md index 93f8629..6fda419 100644 --- a/sql_analysis.md +++ b/sql_analysis.md @@ -31,4 +31,21 @@ select res.created_at, con.reservation_date, res.start_date, room.arrival_date,r order by reservation_date; +``` + +``` +select round(sum(room.total_revenue::numeric)::numeric, 3), con.advertising_medium + + from alpinebits.conversions as con + join alpinebits.room_reservations as room on room.conversion_id = con.id + + + + + where room.total_revenue is not null + and con.reservation_date > '2025-01-01' + group by con.advertising_medium + ; + + ``` \ No newline at end of file diff --git a/src/alpine_bits_python/alpine_bits_helpers.py b/src/alpine_bits_python/alpine_bits_helpers.py index cc32d6f..955fa98 100644 --- a/src/alpine_bits_python/alpine_bits_helpers.py +++ b/src/alpine_bits_python/alpine_bits_helpers.py @@ -634,11 +634,11 @@ def _validate_and_repair_email(email: str | None) -> str | None: return None try: # remove numbers from top-level domain (TLD) if any - email = re.sub(r"\.\d+", ".", email) + #email = re.sub(r"(\.\d+)(@|$)", r"\2", email) email_info = validate_email(email) except EmailNotValidError as e: - _LOGGER.warning("invalid email address: %s", e) + _LOGGER.warning("invalid email address: %s -> %s", email, e) return None return email_info.normalized