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 2021/02/04 09:16:47 UTC

[GitHub] [airflow] heyfavour commented on issue #14060: function can't return

heyfavour commented on issue #14060:
URL: https://github.com/apache/airflow/issues/14060#issuecomment-773156185


   actually it has return statement ,it still can print,but i can't get temp_df
   ```
   def tool_trade_date_hist_sina() -> pd.DataFrame:
       """
       交易日历-历史数据
       https://finance.sina.com.cn/realstock/company/klc_td_sh.txt
       :return: 交易日历
       :rtype: pandas.DataFrame
       """
       url = "https://finance.sina.com.cn/realstock/company/klc_td_sh.txt"
       r = requests.get(url)
       js_code = py_mini_racer.MiniRacer()
       js_code.eval(hk_js_decode)
       dict_list = js_code.call('d', r.text.split("=")[1].split(";")[0].replace('"', ""))  # 执行js解密代码
       temp_df = pd.DataFrame(dict_list)
       temp_df.columns = ["trade_date"]
       temp_df["trade_date"] = pd.to_datetime(temp_df["trade_date"]).dt.date
       temp_df = temp_df.astype(str)
       print(temp_df)
       return temp_df
   ```


----------------------------------------------------------------
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