[
https://issues.apache.org/jira/browse/AIRFLOW-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16678841#comment-16678841
]
ASF GitHub Bot commented on AIRFLOW-3259:
-----------------------------------------
Fokko closed pull request #4114: [AIRFLOW-3259] Fix internal server error when
displaying charts
URL: https://github.com/apache/incubator-airflow/pull/4114
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/www/views.py b/airflow/www/views.py
index fc9e06abd1..67c31bb9b1 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -488,7 +488,7 @@ def chart_data(self):
else:
# User provides columns (x, y, metric1, metric2, ...)
df.index = df[df.columns[0]]
- df = df.sort(df.columns[0])
+ df = df.sort_values(by=df.columns[0])
del df[df.columns[0]]
for col in df.columns:
df[col] = df[col].astype(np.float)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Internal Server Error when creating charts because of sort function
> -------------------------------------------------------------------
>
> Key: AIRFLOW-3259
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3259
> Project: Apache Airflow
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 1.10.0
> Environment: I reproduces this error in two environments
> CentOs 7 with python2.7
> MacOs High Sierra with python 3.6
> Reporter: Zakaria EL Mesaoudi
> Assignee: Zakaria EL Mesaoudi
> Priority: Blocker
> Labels: pull-request-available
> Fix For: 2.0.0
>
> Attachments: Screen Shot 2018-10-25 at 8.01.09 PM.png, Screen Shot
> 2018-10-25 at 8.01.52 PM.png, Screen Shot 2018-10-25 at 8.02.50 PM.png,
> Screen Shot 2018-10-25 at 8.16.53 PM.png
>
>
> h2. {color:#205081}*Problem*{color}
> h3. When you try to create a chart and display metrics you get an internal
> server error (See picture below).
> h3. !Screen Shot 2018-10-25 at 8.01.09 PM.png|width=605,height=222!
> h2. {color:#205081}*Cause*{color}
> h3. When you click on the url rendering the internal server error you get
> this: (See picture below)
> h2. !Screen Shot 2018-10-25 at 8.01.52 PM.png|width=605,height=535!
> h3. A dependency issue: the function "sort" was deprecated and is no longer a
> part of pandas Dataframe and thus it creates a problem when creating charts
> in airflow.
> h2. {color:#205081}*Solution*{color}
> h3. The sort function needs to replaced by sort_values instead (See code
> below)
>
>
> {code:java}
> # Replace this
> df = df.sort(df.columns[0])
> # By this
> df = df.sort_values(by=df.columns[0])
> {code}
> In views.py (See picture below)
> !Screen Shot 2018-10-25 at 8.02.50 PM.png|width=603,height=593!
> h2. {color:#205081}*Result*{color}
> The data is loaded and the chart displayed :D
> !Screen Shot 2018-10-25 at 8.16.53 PM.png|width=607,height=245!
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)