Skip to content

Commit

Permalink
WIP file. Location of merge and execute functions used in main.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Hodson committed Sep 18, 2024
1 parent 885508c commit ade3c38
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lake_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
import uuid
import sys

def execute_command(command):
try:
result = subprocess.run(command, check=True, capture_output=True, text=True)
logging.info("Command output: %s", result.stdout)
return result
except subprocess.CalledProcessError as e:
logging.error("Error executing command: %s", e.stderr)
return e

def lakefs_merge_into_main():
logging.info("Uploading files from data directory to branch...")
command = [
"lakectl", "merge",
f"lakefs://example-repo/ingestion/",
f"lakefs://example-repo/main/",
"-m", "Merge ingestion branch into main"
]
execute_command(command)

class LakeFSManager:
def __init__(self, repo_name):
self.client = Client()
Expand Down

0 comments on commit ade3c38

Please sign in to comment.