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 pyspark.sql import Row | |
my_df_schema = my_df.schema | |
def replace_content(a_row): | |
a_row_dict = a_row.asDict() | |
# Modify the contents of the dict | |
a_row_dict["key"] = "new value" | |
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
#!/bin/bash | |
# The script will generate new snapshots | |
# every execution. It does not look at the amount | |
# of snapshots, only at their age. | |
# ---------- CONSTANTS ---------- | |
retention_period_days=30 | |
last_date_to_back=$(date --date "$retention_period_days days ago") | |
last_date_to_back_seconds=$(date +%s --date "$retention_period_days days ago") |
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
##### | |
# IMPORTS | |
##### | |
from pyspark import TaskContext | |
import os | |
##### | |
# PATHS | |
##### | |
path_model = "/path/to/pretrained/model.h5" |