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 datetime import date, datetime | |
def _convert_date_string_to_epoch(date_string: str) -> Union[int, float]: | |
date_iso = date.fromisoformat(date_string) | |
return datetime.fromordinal(date_iso.toordinal()).timestamp() | |
def _convert_epoch_to_date_string(epoch_time: int) -> str: | |
date_ts = datetime.fromtimestamp(epoch_time) | |
return date_ts.strftime("%Y-%m-%d") |
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 dataclasses import dataclass, field | |
import json | |
import random | |
from confluent_kafka import Consumer, Producer | |
from confluent_kafka.admin import AdminClient, NewTopic | |
from faker import Faker | |
faker = Faker() |
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
import asyncio | |
from confluent_kafka import Consumer, Producer | |
from confluent_kafka.admin import AdminClient, NewTopic | |
BROKER_URL = "PLAINTEXT://localhost:9092" | |
TOPIC_NAME = "my-first-python-topic" | |
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
package com.myproject; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.Properties; | |
public class EnvVarTest { | |
public final Properties properties; |