You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/14 00:59:35 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #9227: Add event log endpoints

kaxil commented on a change in pull request #9227:
URL: https://github.com/apache/airflow/pull/9227#discussion_r439781507



##########
File path: airflow/api_connexion/endpoints/event_log_endpoint.py
##########
@@ -15,19 +15,42 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8135
+from flask import request
 
+from airflow.api_connexion import parameters
+from airflow.api_connexion.exceptions import NotFound
+from airflow.api_connexion.schemas.event_log_schema import (
+    EventLogCollection, event_log_collection_schema, event_log_schema,
+)
+from airflow.models import Log
+from airflow.utils.session import provide_session
 
-def get_event_log():
+
+@provide_session
+def get_event_log(event_log_id, session):
     """
     Get a log entry
     """
-    raise NotImplementedError("Not implemented yet.")
+    query = session.query(Log)
+    query = query.filter(Log.id == event_log_id)
+    event_log = query.one_or_none()

Review comment:
       ```suggestion
       query = session.query(Log).filter(Log.id == event_log_id)
       event_log = query.one_or_none()
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org