> On Jan. 12, 2021, 11:38 p.m., Madhan Neethiraj wrote:
> > intg/src/main/python/apache_atlas/model/glossary.py
> > Line 19 (original), 19 (patched)
> > <https://reviews.apache.org/r/73139/diff/2/?file=2244261#file2244261line19>
> >
> >     Can you please look this following error?
> >     
> >     Traceback (most recent call last):
> >       File "test.py", line 3, in <module>
> >         from apache_atlas.client.base_client import AtlasClient
> >       File 
> > "<...>/atlas/intg/src/main/python/apache_atlas/client/base_client.py", line 
> > 26, in <module>
> >         from apache_atlas.client.discovery import DiscoveryClient
> >       File 
> > "<...>/atlas/intg/src/main/python/apache_atlas/client/discovery.py", line 
> > 18, in <module>
> >         from apache_atlas.model.discovery import (AtlasQuickSearchResult, 
> > AtlasSearchResult,
> >       File 
> > "<...>/atlas/intg/src/main/python/apache_atlas/model/discovery.py", line 
> > 21, in <module>
> >         from apache_atlas.model.instance import AtlasEntityHeader
> >       File 
> > "<...>/atlas/intg/src/main/python/apache_atlas/model/instance.py", line 19, 
> > in <module>
> >         from apache_atlas.model.glossary import AtlasTermAssignmentHeader
> >       File 
> > "<...>/atlas/intg/src/main/python/apache_atlas/model/glossary.py", line 19, 
> > in <module>
> >         import apache_atlas.model.instance as instance
> >     AttributeError: module 'apache_atlas.model' has no attribute 'instance'
> 
> Verdan Mahmood wrote:
>     Can you please share your test.py file? Also, how do you run/install this 
> for testing? 
>     Tried to run with the clean install and things are working properly on my 
> end.
> 
> Madhan Neethiraj wrote:
>     - I ran the sample code in apache-atlas homepage 
> https://pypi.org/project/apache-atlas/
>     - I set env variable PYTHONPATH=<atlas-git-dir>/intg/src/main/python
> 
> Verdan Mahmood wrote:
>     Doing so will raise such import issues as setting PYTHONPATH does not 
> install the packages hence import errors. 
>     Can you please try to run this after installing it locally? i.e., python 
> setup.py install?
> 
> Madhan Neethiraj wrote:
>     The same error even after 'python setup.py install'.
>     
>     # python /tmp/test.py
>     Traceback (most recent call last):
>       File "/tmp/test.py", line 3, in <module>
>         from apache_atlas.client.base_client import AtlasClient
>       File 
> "/usr/local/lib/python3.6/site-packages/apache_atlas-0.0.4-py3.6.egg/apache_atlas/client/base_client.py",
>  line 26, in <module>
>         from apache_atlas.client.discovery import DiscoveryClient
>       File 
> "/usr/local/lib/python3.6/site-packages/apache_atlas-0.0.4-py3.6.egg/apache_atlas/client/discovery.py",
>  line 18, in <module>
>         from apache_atlas.model.discovery import (AtlasQuickSearchResult, 
> AtlasSearchResult,
>       File 
> "/usr/local/lib/python3.6/site-packages/apache_atlas-0.0.4-py3.6.egg/apache_atlas/model/discovery.py",
>  line 21, in <module>
>         from apache_atlas.model.instance import AtlasEntityHeader
>       File 
> "/usr/local/lib/python3.6/site-packages/apache_atlas-0.0.4-py3.6.egg/apache_atlas/model/instance.py",
>  line 19, in <module>
>         from apache_atlas.model.glossary import AtlasTermAssignmentHeader
>       File 
> "/usr/local/lib/python3.6/site-packages/apache_atlas-0.0.4-py3.6.egg/apache_atlas/model/glossary.py",
>  line 19, in <module>
>         import apache_atlas.model.instance as instance
>     AttributeError: module 'apache_atlas.model' has no attribute 'instance'
> 
> Mariusz Górski wrote:
>     I've tested it in clean docker container and works fine (connection 
> refused as expected but it proves there are no issues import-wise):
>     
>     
>     ~ » docker run --network=host --entrypoint=bash --rm -it python:3.7       
>                                                                               
>                     mariusz@mariusz-XPS-13-7390-2-in-1
>     root@mariusz-XPS-13-7390-2-in-1:/# git clone 
> https://github.com/verdan/atlas.git /tmp/atlas; cd /tmp/atlas; git checkout 
> search-improvements
>     Cloning into '/tmp/atlas'...
>     remote: Enumerating objects: 385, done.
>     remote: Counting objects: 100% (385/385), done.
>     remote: Compressing objects: 100% (262/262), done.
>     remote: Total 103641 (delta 146), reused 244 (delta 68), pack-reused 
> 103256
>     Receiving objects: 100% (103641/103641), 58.54 MiB | 16.86 MiB/s, done.
>     Resolving deltas: 100% (47338/47338), done.
>     Branch 'search-improvements' set up to track remote branch 
> 'search-improvements' from 'origin'.
>     Switched to a new branch 'search-improvements'
>     root@mariusz-XPS-13-7390-2-in-1:/tmp/atlas# cd intg/src/main/python/
>     root@mariusz-XPS-13-7390-2-in-1:/tmp/atlas/intg/src/main/python# python3 
> setup.py install > /dev/null
>     root@mariusz-XPS-13-7390-2-in-1:/tmp/atlas/intg/src/main/python# python3 
> /tmp/test.py 
>     Creating test_db
>     Traceback (most recent call last):
>       File 
> "/usr/local/lib/python3.7/site-packages/urllib3-1.26.2-py3.7.egg/urllib3/connection.py",
>  line 170, in _new_conn
>         (self._dns_host, self.port), self.timeout, **extra_kw
>       File 
> "/usr/local/lib/python3.7/site-packages/urllib3-1.26.2-py3.7.egg/urllib3/util/connection.py",
>  line 96, in create_connection
>         raise err
>       File 
> "/usr/local/lib/python3.7/site-packages/urllib3-1.26.2-py3.7.egg/urllib3/util/connection.py",
>  line 86, in create_connection
>         sock.connect(sa)
>     ConnectionRefusedError: [Errno 111] Connection refused

- I see this error in CentOS7 that runs Python 3.6.8
- This error is not seen in my docker container running Ubuntu and Python 3.8.6
- This error is not seen in your docker container that runs Python 3.7

Not sure if this is specific to 3.6.8.

Anyway, I will go ahead and merge this fix. Thanks Mariusz and Verdan for 
working through this.


- Madhan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73139/#review222454
-----------------------------------------------------------


On Jan. 12, 2021, 9:54 p.m., Verdan Mahmood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73139/
> -----------------------------------------------------------
> 
> (Updated Jan. 12, 2021, 9:54 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Pinal Shah, and Sarath 
> Subramanian.
> 
> 
> Bugs: ATLAS-4086
>     https://issues.apache.org/jira/browse/ATLAS-4086
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Signed-off-by: verdan <verdan.mahm...@gmail.com>
> 
> This review request fixes a number of major issues in the python atlas client.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/python/apache_atlas/client/admin.py 
> ebe72dcc79b18b5955f5403889895bc7bfe4923b 
>   intg/src/main/python/apache_atlas/client/discovery.py 
> 04f5fc9cf68edbd5973d48b402d764030a7068ca 
>   intg/src/main/python/apache_atlas/client/entity.py 
> 7edacf9e72a3a5d3cc55008b39b60fb88dc5c607 
>   intg/src/main/python/apache_atlas/client/glossary.py 
> efa0612fa0c78b850b7df76cc7e89d183ffb8e41 
>   intg/src/main/python/apache_atlas/client/relationship.py 
> f5790a4c369b6f2a517b81425d8fa237ca2b7cdc 
>   intg/src/main/python/apache_atlas/client/typedef.py 
> aa1581d86df26979f3a6c6bb798ea7b0f6ab3bd0 
>   intg/src/main/python/apache_atlas/model/glossary.py 
> 7a0faac37f3c74cdd0eb49012b88c376323e4b3f 
>   intg/src/main/python/apache_atlas/model/instance.py 
> 8cfb254c49328b495454158eec26bd1cc250b929 
>   intg/src/main/python/setup.py 7c563c9c0610eeba169b1c8bec73a246c2a95d4b 
> 
> 
> Diff: https://reviews.apache.org/r/73139/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Verdan Mahmood
> 
>

Reply via email to