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

gcivil-nyu-org / team1-mon-spring26 / 261

05 May 2026 11:12PM UTC coverage: 86.506% (-1.7%) from 88.245%
261

Pull #157

travis-pro

web-flow
Merge e77e0869a into da389439e
Pull Request #157: fix for s3 signed urls

200 of 272 new or added lines in 4 files covered. (73.53%)

1 existing line in 1 file now uncovered.

1218 of 1408 relevant lines covered (86.51%)

0.87 hits per line

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

0.0
/maps/management/commands/create_dynamodb_table.py
NEW
1
import boto3
×
NEW
2
from django.core.management.base import BaseCommand
×
NEW
3
from django.conf import settings
×
4

5

NEW
6
class Command(BaseCommand):
×
NEW
7
    help = "Creates the DynamoDB table if it does not exist"
×
8

NEW
9
    def handle(self, *args, **options):
×
NEW
10
        table_name = settings.DYNAMODB_TABLE_NAME
×
NEW
11
        region = settings.DYNAMODB_REGION
×
NEW
12
        endpoint_url = getattr(settings, "DYNAMODB_ENDPOINT_URL", None)
×
13

NEW
14
        kwargs = {"region_name": region}
×
NEW
15
        if endpoint_url:
×
NEW
16
            kwargs["endpoint_url"] = endpoint_url
×
17

NEW
18
        dynamodb = boto3.resource("dynamodb", **kwargs)
×
NEW
19
        client = boto3.client("dynamodb", **kwargs)
×
20

NEW
21
        try:
×
NEW
22
            client.describe_table(TableName=table_name)
×
NEW
23
            self.stdout.write(
×
24
                self.style.SUCCESS(
25
                    f"Table '{table_name}' already exists. Skipping creation."
26
                )
27
            )
NEW
28
        except client.exceptions.ResourceNotFoundException:
×
NEW
29
            self.stdout.write(f"Creating DynamoDB table '{table_name}'...")
×
NEW
30
            table = dynamodb.create_table(
×
31
                TableName=table_name,
32
                KeySchema=[
33
                    {"AttributeName": "PK", "KeyType": "HASH"},
34
                    {"AttributeName": "SK", "KeyType": "RANGE"},
35
                ],
36
                AttributeDefinitions=[
37
                    {"AttributeName": "PK", "AttributeType": "S"},
38
                    {"AttributeName": "SK", "AttributeType": "S"},
39
                    {"AttributeName": "GSI1PK", "AttributeType": "S"},
40
                    {"AttributeName": "GSI1SK", "AttributeType": "S"},
41
                ],
42
                GlobalSecondaryIndexes=[
43
                    {
44
                        "IndexName": "GeohashIndex",
45
                        "KeySchema": [
46
                            {"AttributeName": "GSI1PK", "KeyType": "HASH"},
47
                            {"AttributeName": "GSI1SK", "KeyType": "RANGE"},
48
                        ],
49
                        "Projection": {"ProjectionType": "ALL"},
50
                        "ProvisionedThroughput": {
51
                            "ReadCapacityUnits": 5,
52
                            "WriteCapacityUnits": 5,
53
                        },
54
                    }
55
                ],
56
                BillingMode="PROVISIONED",
57
                ProvisionedThroughput={
58
                    "ReadCapacityUnits": 20,
59
                    "WriteCapacityUnits": 20,
60
                },
61
            )
NEW
62
            table.meta.client.get_waiter("table_exists").wait(TableName=table_name)
×
NEW
63
            self.stdout.write(
×
64
                self.style.SUCCESS(f"Table '{table_name}' created successfully!")
65
            )
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