SuperCowPowers / sageworks

SageWorks: An easy to use Python API for creating and deploying AWS SageMaker Models
https://www.supercowpowers.com
MIT License
37 stars 1 forks source link

Issue with 'count' query #424

Closed brifordwylie closed 3 months ago

brifordwylie commented 3 months ago

So this query will fail if the existing data has a count column in it, so the simplest/best thing to do here is just use a field name like _sageworks_count and that way it won't conflict with existing column names.

 # Combined query to get both top and bottom counts
            query = (
                f'(SELECT "{column}", count(*) as count '
                f"FROM {table} "
                f'GROUP BY "{column}" ORDER BY count DESC LIMIT 20) '
                f"UNION ALL "
                f'(SELECT "{column}", count(*) as count '
                f"FROM {table} "
                f'GROUP BY "{column}" ORDER BY count ASC LIMIT 20)'
            )
brifordwylie commented 3 months ago

This has been fixed