From dev-return-6246-archive-asf-public=cust-asf.ponee.io@madlib.apache.org Wed Oct 21 00:54:29 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id CF437180642 for ; Wed, 21 Oct 2020 02:54:29 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 407C8635D7 for ; Wed, 21 Oct 2020 00:54:29 +0000 (UTC) Received: (qmail 39104 invoked by uid 500); 21 Oct 2020 00:54:28 -0000 Mailing-List: contact dev-help@madlib.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@madlib.apache.org Delivered-To: mailing list dev@madlib.apache.org Received: (qmail 39091 invoked by uid 99); 21 Oct 2020 00:54:28 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Oct 2020 00:54:28 +0000 From: =?utf-8?q?GitBox?= To: dev@madlib.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bmadlib=5D_kaknikhil_commented_on_a_change_in_pull_?= =?utf-8?q?request_=23522=3A_DL=3A_Remove_keras_dependency?= Message-ID: <160324166824.32230.7190677492285774165.asfpy@gitbox.apache.org> Date: Wed, 21 Oct 2020 00:54:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: kaknikhil commented on a change in pull request #522: URL: https://github.com/apache/madlib/pull/522#discussion_r508925083 ########## File path: src/ports/postgres/modules/deep_learning/test/unit_tests/test_madlib_keras.py_in ########## @@ -28,12 +28,13 @@ from os import path sys.path.append(path.dirname(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))))) sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__))))) -import keras -from keras.models import * -from keras.layers import * import unittest from mock import * import plpy_mock as plpy + +from tensorflow import keras +from tensorflow.keras.models import * +from tensorflow.keras.layers import * Review comment: Because of these imports, the `__name__` variable changes from __main__ to ` from tensorflow.keras.layers import *` which makes it so that none of the tests get run. Looks like this is a bug in tf 1.14 (which has been fixed in 2.0) A quick way to fix this would be to move these imports to inside the `if __name__ == '__main__'` code block. This probably won't be a problem for our source code since we don't depend on the `__name__` variable but we should at least look into it. ---------------------------------------------------------------- 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