Completed
Push — dev ( 758492...fa5ee5 )
by
unknown
26s queued 15s
created

data.datasets.low_flex_scenario   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 19
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A LowFlexScenario.__init__() 0 14 1
1
"""The central module to create low flex scenarios
2
3
"""
4
from airflow.operators.postgres_operator import PostgresOperator
5
from sqlalchemy.ext.declarative import declarative_base
6
import importlib_resources as resources
7
8
from egon.data.datasets import Dataset
9
10
11
Base = declarative_base()
12
13
14
class LowFlexScenario(Dataset):
15
    def __init__(self, dependencies):
16
        super().__init__(
17
            name="low_flex_scenario",
18
            version="0.0.0",
19
            dependencies=dependencies,
20
            tasks=(
21
                {
22
                    PostgresOperator(
23
                        task_id="low_flex_eGon2035",
24
                        sql=resources.read_text(
25
                            __name__, "low_flex_eGon2035.sql"
26
                        ),
27
                        postgres_conn_id="egon_data",
28
                        autocommit=True,
29
                    ),
30
                },
31
            ),
32
        )
33