• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jyablonski / python_docker / 16378074149

18 Jul 2025 06:48PM UTC coverage: 83.993% (+2.1%) from 81.898%
16378074149

push

github

web-flow
Ingestion v2.0.8 (#103)

### Description
Ruff Linting Updates

## Added
- New Ruff Linting Rules

## Updated
- Docstrings to accommodate new Linting Rules
- `return` cleanup & optimizations

## Deleted
- None

15 of 29 new or added lines in 5 files covered. (51.72%)

1 existing line in 1 file now uncovered.

467 of 556 relevant lines covered (83.99%)

1.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/database.py
1
import logging
2✔
2

3
import pandas as pd
2✔
4

5

6
def write_to_sql(con, table_name: str, df: pd.DataFrame, table_type: str) -> None:
2✔
7
    """Simple Wrapper Function to write a Pandas DataFrame to SQL
8

9
    Args:
10
        con (SQL Connection): The connection to the SQL DB.
11

12
        table_name (str): The Table name to write to SQL as.
13

14
        df (DataFrame): The Pandas DataFrame to store in SQL
15

16
        table_type (str): Whether the table should replace or append to an
17
            existing SQL Table under that name
18

19
    Returns:
20
        Writes the Pandas DataFrame to a Table in the Schema we connected to.
21

22
    """
23
    try:
2✔
24
        if len(df) == 0:
2✔
25
            logging.info(f"{table_name} is empty, not writing to SQL")
×
26
        else:
27
            df.to_sql(
2✔
28
                con=con,
29
                name=table_name,
30
                index=False,
31
                if_exists=table_type,
32
            )
33
            logging.info(
2✔
34
                f"Writing {len(df)} {table_name} rows to aws_{table_name}_source to SQL"
35
            )
36

37
        return
2✔
38
    except Exception as error:
×
39
        logging.error(f"SQL Write Script Failed, {error}")
×
NEW
40
        return
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc