Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def schedule_planting_service(
logger.info("Details: %s", details)
# MOCK API RESPONSE - Replace with actual API call to your scheduling system
# Calculate confirmation time based on date and time_range
start_time_str = time_range.split("-")[0] # Get the start time (e.g., "9")
start_time_str = time_range.split("-", maxsplit=1)[0] # Get the start time (e.g., "9")
confirmation_time_str = (
f"{date} {start_time_str}:00" # e.g., "2024-07-29 9:00"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def parse_response(response: str) -> str:
query = response
try:
if "```sql" in response and "```" in response:
query = response.split("```sql")[1].split("```")[0]
query = response.split("```sql")[1].split("```", maxsplit=1)[0]
except ValueError as e:
print(f"Error in parsing response: {e}")
query = response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def run_dataproc_template(

# IF NEED TO INTEGRATE TRANSFORMATION LOGIC
if TRANSFORMATION_SQL:
template_file_name = template_path.split("/")[-1]
template_file_name = template_path.rsplit("/", maxsplit=1)[-1]
template_dir = os.path.dirname(template_path)

# CREATE THE TEMP TEMPLATE REPO WITH INTEGRATED TRANSFORMATION LOGIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _parse_repo_path(repository: str) -> tuple[str | None, str | None]:
Returns (None, None) if the format is invalid.
"""
if repository.startswith(("http://", "https://")):
repo_path = repository.split("github.com/")[-1].rstrip(".git")
repo_path = repository.rsplit("github.com/", maxsplit=1)[-1].rstrip(".git")
else:
repo_path = repository
if "/" not in repo_path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def _load_single_clip(
f.write(artifact.inline_data.data)

clip = VideoFileClip(temp_path)
clip_index_str = filename.split("_")[0]
clip_index_str = filename.split("_", maxsplit=1)[0]
if clip_index_str.isdigit():
clip_index = int(clip_index_str)
if 0 <= clip_index < len(storyline):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def ensure_image_artifact(
exc_info=True,
)
# Fall through to try loading as an artifact
image_filename = image_filename.split("/")[-1]
image_filename = image_filename.rsplit("/", maxsplit=1)[-1]

try:
logging.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware


# Add app directory to path for imports
# Structure: app/frontend/backend/main.py
app_dir = Path(__file__).parent.parent.parent # app/
Expand Down
Loading