-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9518787
commit 56b8a79
Showing
9 changed files
with
63 additions
and
64 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import os | ||
|
||
|
||
def logFileName(file: str) -> str: | ||
def log_file_name(file: str) -> str: | ||
current_dir = os.path.dirname(os.path.relpath(file)) | ||
WORK_DIR = current_dir.split("/")[-1:][0] | ||
return WORK_DIR | ||
return current_dir.split("/")[-1:][0] |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import time | ||
import queue | ||
from tqdm import tqdm | ||
from etl.common.utils.logs import loggingInfo | ||
from etl.config.logFile import logFileName | ||
from etl.config.logFile import log_file_name | ||
|
||
|
||
WORK_DIR = logFileName(file=__file__) | ||
WORK_DIR = log_file_name(file=__file__) | ||
|
||
|
||
class transformation: | ||
def __init__(self, json_response: dict, params, fila: object): | ||
def __init__(self, json_response: dict, params, queue: queue.Queue): | ||
self.json_response = json_response | ||
self.validParams = params | ||
self.fila = fila | ||
self.valid_params = params | ||
self.queue = queue | ||
|
||
def publish(self): | ||
for param in tqdm( | ||
self.validParams, total=len(self.validParams), desc="Producing Data" | ||
self.valid_params, total=len(self.valid_params), desc="Producing Data" | ||
): | ||
dic = self.json_response[param.replace("-", "")] | ||
time.sleep(0.2) | ||
self.fila.put(dic) # type: ignore | ||
self.queue.put(dic) |
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
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