Skip to content

Commit

Permalink
Removed trailing whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Rodríguez Flores committed Jan 16, 2024
1 parent 8b63f30 commit 04ec59e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion resources/src/druid/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def execute_query(self, druid_query):
Returns:
dict: The response from the Druid query in JSON format.
Raises:
Exception: If the Druid query fails with a non-200 status code.
"""
Expand Down
15 changes: 7 additions & 8 deletions resources/src/druid/query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class QueryBuilder:
def __init__(self, aggregations, post_aggregations):
"""
Initializer of the class
Args:
aggregations (string): path to json file with the 'aggregations'
value of the druid query.
Expand Down Expand Up @@ -84,9 +84,9 @@ def modify_aggregations(self, query):
"""
Modify a druid query to add every field the traffic module uses.
Those are: "bytes", "pkts", "clients", "flows", "bps", "pps", "fps",
"bytes_per_client" , "bytes_per_sec_per_client", "flows_per_client"
"bytes_per_client" , "bytes_per_sec_per_client", "flows_per_client"
and "flows_per_sec_per_client".
Args:
-query (dict): dicitionary with the druid query.
Returns:
Expand All @@ -104,7 +104,7 @@ def modify_aggregations(self, query):
def modify_granularity(self, query, gran):
"""
Modify the granularity of a druid query.
Args:
-query (dict): dicitionary with the druid query.
-granularity (string): druid granularity.
Expand All @@ -118,7 +118,7 @@ def modify_granularity(self, query, gran):
def modify_filter(self, query, filter_druid):
"""
Modify a druid query to add a filter of the traffic module.
Args:
-query (dict): dicitionary with the serialized druid query.
-filter_druid (dict): dictionary with the serialized filter.
Expand All @@ -132,7 +132,7 @@ def modify_filter(self, query, filter_druid):
def set_time_origin(self, query, time):
"""
Modify a druid query to change time origin
Args:
-query: dictionary with the druid query.
Returns:
Expand All @@ -145,7 +145,7 @@ def set_time_origin(self, query, time):
def set_time_interval(self, query, time_start, time_end):
"""
Modify a druid query to change time interval
Args:
-query: dictionary with the druid query.
-time_start: the start time of the data to retrieve.
Expand All @@ -158,4 +158,3 @@ def set_time_interval(self, query, time_start, time_end):
f"{time_start}/{time_end}"
]
return new_query

2 changes: 1 addition & 1 deletion resources/src/redborder/async_jobs/train_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_model_filter(self, model_name):
Args:
model_name (str): The identifier of the model.
Returns:
(dict): Dictionary with the filter of the model.
"""
Expand Down
5 changes: 2 additions & 3 deletions resources/src/redborder/rq.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def fetch_redis_secret(self):
str: redis secret
"""
return config.get("Redis", "rd_secret")

def fetch_model_names(self):
"""
Fetch model names from the config file
Returns:
str: model names
"""
return config.get("Outliers", "model_names")

def cron_to_rq_datetime(self, cron_expression):
"""
Convert a cron expression to a valid datetime object for the next scheduled time.
Expand Down Expand Up @@ -120,4 +120,3 @@ def schedule_train_job(self):
logger.info("Waiting for re-queue...")
time.sleep(delay)
self.schedule_train_job()

0 comments on commit 04ec59e

Please sign in to comment.