def test_get_paginated_record_ids_otel_without_record_id(self):
        """Test that _get_paginated_record_ids_otel handles events without record IDs correctly."""
        # Create an event without a record_id
        empty_record_id_event = self._create_event_from_template(
            event_id="event_without_record_id",
            record_id="",  # Empty record_id
            app_name=self.app_name,
            app_version=self.app_version,
            app_id=self.app_id,
            start_timestamp="2025-04-11 10:19:55.993997",
            timestamp="2025-04-11 10:19:56.356310",
        )
        self.db.insert_event(empty_record_id_event)

        # Create a normal event with a record_id
        normal_event = self._create_event_from_template(
            event_id="normal_event",
            record_id="normal_record_id",
            app_name=self.app_name,
            app_version=self.app_version,
            app_id=self.app_id,
            start_timestamp="2025-04-11 10:19:55.993997",
            timestamp="2025-04-11 10:19:56.356310",
        )
        self.db.insert_event(normal_event)

        with self.db.session.begin() as session:
            stmt = self.db._get_paginated_record_ids_otel()
            results = session.execute(stmt).all()

            # Should only return the event with a valid record_id
            self.assertEqual(len(results), 1)
            self.assertEqual(results[0].record_id, "normal_record_id")
Test that _get_paginated_record_ids_otel handles events without record IDs correctly.
tests/unit/test_otel_get_records_and_feedback.py