Skip to content

Commit 40817a6

Browse files
committed
Mroe tweaks
1 parent 9904a5b commit 40817a6

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

dg_projects/learning_resources/learning_resources/sensors/youtube_shorts.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
DefaultSensorStatus,
1818
RunRequest,
1919
SensorResult,
20-
SkipReason,
2120
sensor,
2221
)
2322

@@ -214,25 +213,6 @@ def fetch_and_log_video_metadata(youtube_client, youtube_config_provider):
214213
return current_video_ids, metadata_by_video_id
215214

216215

217-
def determine_videos_to_process(current_video_ids, successfully_processed):
218-
"""
219-
Determine which videos need processing (new or failed).
220-
221-
Returns:
222-
Set of video IDs to process
223-
"""
224-
videos_to_process = current_video_ids - successfully_processed
225-
226-
if not videos_to_process:
227-
# Assign message to variable for clarity
228-
skip_reason_message = (
229-
"No videos need processing and none were removed from YouTube"
230-
)
231-
raise SkipReason(skip_reason_message)
232-
233-
return videos_to_process
234-
235-
236216
def create_run_requests(videos_to_process, metadata_by_video_id):
237217
"""
238218
Create run requests for videos that need processing.
@@ -326,9 +306,7 @@ def youtube_shorts_sensor(context):
326306
)
327307

328308
# Determine videos that need processing (new or failed)
329-
videos_to_process = determine_videos_to_process(
330-
current_video_ids, successfully_processed
331-
)
309+
videos_to_process = current_video_ids - successfully_processed
332310

333311
# Create run requests for videos that need processing
334312
run_requests = create_run_requests(videos_to_process, metadata_by_video_id)
@@ -354,9 +332,6 @@ def youtube_shorts_sensor(context):
354332
cursor=cursor_json,
355333
)
356334

357-
except SkipReason as skip:
358-
return skip
359-
360335
except Exception as e:
361336
msg = f"Error in youtube_shorts_sensor: {e!s}"
362337
context.log.exception(msg)

0 commit comments

Comments
 (0)