This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testgist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
##### SETTING OPERATING SYSTEM ##### | |
################################################### | |
# This is an official python image. | |
FROM python:3.11.6-bookworm | |
# Set the user to root. | |
USER root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
volumes: | |
local-dbt-env-shell-history: # This basically let's docker auto-manage this volume. | |
services: | |
local-dbt-env: | |
profiles: | |
- development | |
platform: linux/amd64 # We force the platform for consistency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
networks: | |
local_dev_network: | |
driver: bridge | |
ipam: | |
driver: default | |
config: | |
- subnet: 172.23.0.0/16 | |
gateway: 172.23.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"name": "dbt dev env", | |
"dockerComposeFile": "./docker-compose.yml", | |
"service": "local-dbt-env", | |
"runServices": ["local-dbt-env"], | |
"hostRequirements": { | |
"cpus": 4, | |
"memory": "8gb", | |
"storage": "30gb" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
class Animal(ABC): | |
@abstractmethod | |
def make_sound(self): | |
"""Each subclass must implement a method to make a specific animal sound.""" | |
pass | |
@abstractmethod | |
def move(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
class DataSource(ABC): | |
@classmethod | |
@abstractmethod | |
def configure(cls, config): | |
""" | |
Configures database connection parameters. Each subclass must implement this | |
method based on its database type specifications. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
class DataFormatter(ABC): | |
@staticmethod | |
@abstractmethod | |
def format_data(data): | |
"""Define a standard way to format data.""" | |
pass | |
class JSONFormatter(DataFormatter): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
class DatabaseConfig(ABC): | |
@property | |
@abstractmethod | |
def connection_string(self): | |
"""Define a standardized property to get a database connection string.""" | |
pass | |
class ProductionDatabaseConfig(DatabaseConfig): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
from contextlib import contextmanager | |
from cryptography.fernet import Fernet | |
class CryptoFileManager(ABC): | |
@abstractmethod | |
@contextmanager | |
def secure_file_handler(self, path, mode, key): | |
"""A context manager for encrypting or decrypting files.""" | |
pass |
OlderNewer