content: # Copyright Contributors to the Amundsen project.
  # SPDX-License-Identifier: Apache-2.0
  
  import copy
  import textwrap
  import unittest
  from collections import namedtuple
  from typing import Any, Dict  # noqa: F401
  from unittest.mock import MagicMock, patch
  
  from amundsen_common.entity.resource_type import ResourceType
  from amundsen_common.models.api import health_check
  from amundsen_common.models.dashboard import DashboardSummary
  from amundsen_common.models.feature import Feature, FeatureWatermark
  from amundsen_common.models.generation_code import GenerationCode
  from amundsen_common.models.lineage import Lineage, LineageItem
  from amundsen_common.models.popular_table import PopularTable
  from amundsen_common.models.table import (Application, Badge, Column,
                                            ProgrammaticDescription,
                                            ResourceReport, Source, SqlJoin,
                                            SqlWhere, Stat, Table, TableSummary,
                                            Tag, TypeMetadata, User, Watermark)
  from amundsen_common.models.user import User as UserModel
  from neo4j import GraphDatabase
  from neo4j.exceptions import ClientError
  
  from metadata_service import create_app
  from metadata_service.entity.dashboard_detail import DashboardDetail
  from metadata_service.entity.dashboard_query import DashboardQuery
  from metadata_service.entity.tag_detail import TagDetail
  from metadata_service.exception import NotFoundException
  from metadata_service.proxy.neo4j_proxy import Neo4jProxy
  from metadata_service.util import UserResourceRel
  
  
  class TestNeo4jProxy(unittest.TestCase):
  
      def setUp(self) -> None:
          self.app = create_app(config_module_class='metadata_service.config.LocalConfig')
          self.app_context = self.app.app_context()
          self.app_context.push()
  
          table_entry = {'db': {'name': 'hive'},
                         'clstr': {
                             'name': 'gold'},
                         'schema': {
                             'name': 'foo_schema'},
                         'tbl': {
                             'name': 'foo_table'},
                         'tbl_dscrpt': {
                             'description': 'foo description'}
                         }
  
          col1 = copy.deepcopy(table_entry)  # type: Dict[Any, Any]
          col1['col'] = {'name': 'bar_id_1',
                         'col_type': 'array<struct<c1:string,c2:array<string>,'
                                     'c3:map<string,string>,c4:struct<c5:int,c6:int>>>',
                         'sort_order': 0}
          col1['col_dscrpt'] = {'description': 'bar col description'}
          col1['col_stats'] = [{'stat_type': 'avg', 'start_epoch': 1, 'end_epoch': 1, 'stat_val': '1'}]
          col1['col_badges'] = []
          col1['col_type_metadata'] = [{'node': {'kind': 'array', 'name': 'bar_id_1',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1',
                                                 'data_type': 'array<struct<c1:string,c2:array<string>,'
                                                              'c3:map<string,string>,c4:struct<c5:int,c6:int>>>'}},
                                       {'node': {'kind': 'struct', 'name': '_inner_',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_',
                                                 'data_type': 'struct<c1:string,c2:array<string>,'
                                                              'c3:map<string,string>,c4:struct<c5:int,c6:int>>'}},
                                       {'node': {'kind': 'scalar', 'name': 'c1',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c1',
                                                 'data_type': 'string', 'sort_order': 0}},
                                       {'node': {'kind': 'array', 'name': 'c2',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c2',
                                                 'data_type': 'array<string>', 'sort_order': 1}},
                                       {'node': {'kind': 'map', 'name': 'c3',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c3',
                                                 'data_type': 'map<string,string>', 'sort_order': 2}},
                                       {'node': {'kind': 'struct', 'name': 'c4',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c4',
                                                 'data_type': 'struct<c5:int,c6:int>', 'sort_order': 3}},
                                       {'node': {'kind': 'scalar', 'name': 'map_key',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c3/map_key',
                                                 'data_type': 'string'}},
                                       {'node': {'kind': 'scalar', 'name': 'map_value',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c3/map_value',
                                                 'data_type': 'string'}},
                                       {'node': {'kind': 'scalar', 'name': 'c5',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c4/c5',
                                                 'data_type': 'int', 'sort_order': 0}},
                                       {'node': {'kind': 'scalar', 'name': 'c6',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_'
                                                        '/c4/c6',
                                                 'data_type': 'int', 'sort_order': 1}}]
  
          col2 = copy.deepcopy(table_entry)  # type: Dict[Any, Any]
          col2['col'] = {'name': 'bar_id_2',
                         'col_type': 'array<struct<c1:string,c2:array<string>>>',
                         'sort_order': 1}
          col2['col_dscrpt'] = {'description': 'bar col2 description'}
          col2['col_stats'] = [{'stat_type': 'avg', 'start_epoch': 2, 'end_epoch': 2, 'stat_val': '2'}]
          col2['col_badges'] = [{'key': 'primary key', 'category': 'column'}]
          col2['col_type_metadata'] = [{'node': {'kind': 'array', 'name': 'bar_id_2',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2',
                                                 'data_type': 'array<struct<c1:string,c2:array<string>>>'},
                                        'description': {'description': 'Array description',
                                                        'description_source': 'description',
                                                        'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2'
                                                               '/_description'}},
                                       {'node': {'kind': 'struct', 'name': '_inner_',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_',
                                                 'data_type': 'struct<c1:string,c2:array<string>>'}},
                                       {'node': {'kind': 'scalar', 'name': 'c1',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_'
                                                        '/c1',
                                                 'data_type': 'string', 'sort_order': 0},
                                        'description': {'description': 'String description',
                                                        'description_source': 'description',
                                                        'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2'
                                                               '/_inner_/c1/_description'}},
                                       {'node': {'kind': 'array', 'name': 'c2',
                                                 'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_'
                                                        '/c2',
                                                 'data_type': 'array<string>', 'sort_order': 1},
                                       'description': {'description': 'Array description',
                                                       'description_source': 'description',
                                                       'key': 'hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2'
                                                              '/_inner_/c2/_description'},
                                        'badges': [{'key': 'primary key', 'category': 'column'},
                                                   {'key': 'pii', 'category': 'column'}]}]
  
          app1 = {
              'application_url': 'url1',
              'name': 'Airflow',
              'id': 'id1',
          }
          app2 = {
              'application_url': 'url2',
              'name': 'Airflow',
              'id': 'id2',
          }
  
          table_level_results = [{
              'wmk_records': [
                  {
                      'key': 'hive://gold.test_schema/test_table/high_watermark/',
                      'partition_key': 'ds',
                      'partition_value': 'fake_value',
                      'create_time': 'fake_time',
                  },
                  {
                      'key': 'hive://gold.test_schema/test_table/low_watermark/',
                      'partition_key': 'ds',
                      'partition_value': 'fake_value',
                      'create_time': 'fake_time',
                  }
              ],
              'producing_apps': [app1],
              'consuming_apps': [app2],
              'resource_reports': [
                  {
                      'name': 'test_report',
                      'url': 'https://test.report/index.html'
                  }
              ],
              'last_updated_timestamp': 1,
              'tag_records': [
                  {
                      'key': 'test',
                      'tag_type': 'default'
                  }
              ],
              'badge_records': [
                  {
                      'key': 'golden',
                      'category': 'table_status'
                  }
              ],
              'src': {
                  'source': '/source_file_loc',
                  'key': 'some key',
                  'source_type': 'github'
              },
              'prog_descriptions': [
                  {
                      'description_source': 's3_crawler',
                      'description': 'Test Test Test'
                  },
                  {
                      'description_source': 'quality_report',
                      'description': 'Test Test'
                  }
              ]
          }]
  
          table_common_usage = [{
              'joins': [
                  {
                      'join_exec_cnt': 2,
                      'join': {
                          'join_sql': (
                              'statewide_cases cases '
                              'join statewide_testing tests on cases.newcountconfirmed <= tests.tested'
                          ),
                          'join_type': 'inner join',
                          'joined_on_column': 'newcountconfirmed',
                          'joined_on_table': {
                              'schema': 'open_data',
                              'cluster': 'ca_covid',
                              'database': 'snowflake',
                              'name': 'statewide_testing'
                          },
                          'column': 'newcountconfirmed'
                      }
                  }
              ],
              'filters': [
                  {
                      'where_clause': 'b.countnewestcases <= 15',
                      'where_exec_cnt': 2
                  }
              ]
          }]
  
          owners_results = [{'owner_records': [
              {
                  'key': 'tester@example.com',
                  'email': 'tester@example.com',
                  'updated_at': 0,
              }
          ], }]
  
          last_updated_timestamp = '01'
  
          self.col_usage_return_value = [
              col1,
              col2
          ]
          self.table_level_return_value = table_level_results
  
          self.app_producing, self.app_consuming = app1, app2
  
          self.last_updated_timestamp = last_updated_timestamp
  
          self.table_common_usage = table_common_usage
  
          self.owners_return_value = owners_results
  
          self.col_bar_id_1_expected_type_metadata = self._get_col_bar_id_1_expected_type_metadata()
          self.col_bar_id_2_expected_type_metadata = self._get_col_bar_id_2_expected_type_metadata()
  
      def _get_col_bar_id_1_expected_type_metadata(self) -> TypeMetadata:
          bar_id_1_c3_map_key_tm = TypeMetadata(kind='scalar', name='map_key',
                                                key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1'
                                                    '/_inner_/c3/map_key',
                                                data_type='string', sort_order=0)
          bar_id_1_c3_map_value_tm = TypeMetadata(kind='scalar', name='map_value',
                                                  key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1'
                                                      '/_inner_/c3/map_value',
                                                  data_type='string', sort_order=0)
          bar_id_1_c4_c5_tm = TypeMetadata(kind='scalar', name='c5',
                                           key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1'
                                               '/_inner_/c4/c5',
                                           data_type='int', sort_order=0)
          bar_id_1_c4_c6_tm = TypeMetadata(kind='scalar', name='c6',
                                           key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1'
                                               '/_inner_/c4/c6',
                                           data_type='int', sort_order=1)
          bar_id_1_c1_tm = TypeMetadata(kind='scalar', name='c1',
                                        key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_/c1',
                                        data_type='string', sort_order=0)
          bar_id_1_c2_tm = TypeMetadata(kind='array', name='c2',
                                        key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_/c2',
                                        data_type='array<string>', sort_order=1)
          bar_id_1_c3_tm = TypeMetadata(kind='map', name='c3',
                                        key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_/c3',
                                        data_type='map<string,string>', sort_order=2,
                                        children=[bar_id_1_c3_map_key_tm, bar_id_1_c3_map_value_tm])
          bar_id_1_c4_tm = TypeMetadata(kind='struct', name='c4',
                                        key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_/c4',
                                        data_type='struct<c5:int,c6:int>', sort_order=3,
                                        children=[bar_id_1_c4_c5_tm, bar_id_1_c4_c6_tm])
          bar_id_1_struct_tm = TypeMetadata(kind='struct', name='_inner_',
                                            key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1/_inner_',
                                            data_type='struct<c1:string,c2:array<string>,'
                                                      'c3:map<string,string>,c4:struct<c5:int,c6:int>>', sort_order=0,
                                            children=[bar_id_1_c1_tm, bar_id_1_c2_tm, bar_id_1_c3_tm, bar_id_1_c4_tm])
          bar_id_1_type_metadata = TypeMetadata(kind='array', name='bar_id_1',
                                                key='hive://gold.foo_schema/foo_table/bar_id_1/type/bar_id_1',
                                                data_type='array<struct<c1:string,c2:array<string>,'
                                                          'c3:map<string,string>,c4:struct<c5:int,c6:int>>>',
                                                sort_order=0, children=[bar_id_1_struct_tm])
          return bar_id_1_type_metadata
  
      def _get_col_bar_id_2_expected_type_metadata(self) -> TypeMetadata:
          bar_id_2_c1_tm = TypeMetadata(kind='scalar', name='c1',
                                        key='hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_/c1',
                                        description='String description',
                                        data_type='string', sort_order=0)
          bar_id_2_c2_tm = TypeMetadata(kind='array', name='c2',
                                        key='hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_/c2',
                                        description='Array description',
                                        data_type='array<string>', sort_order=1,
                                        badges=[Badge(badge_name='primary key', category='column'),
                                                Badge(badge_name='pii', category='column')])
          bar_id_2_struct_tm = TypeMetadata(kind='struct', name='_inner_',
                                            key='hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2/_inner_',
                                            data_type='struct<c1:string,c2:array<string>>', sort_order=0,
                                            children=[bar_id_2_c1_tm, bar_id_2_c2_tm])
          bar_id_2_type_metadata = TypeMetadata(kind='array', name='bar_id_2',
                                                key='hive://gold.foo_schema/foo_table/bar_id_2/type/bar_id_2',
                                                description='Array description',
                                                data_type='array<struct<c1:string,c2:array<string>>>', sort_order=0,
                                                children=[bar_id_2_struct_tm])
          return bar_id_2_type_metadata
  
      def tearDown(self) -> None:
          pass
  
      def test_health_neo4j(self) -> None:
          # Test health when the enterprise version is used
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              mock_execute.return_value = [
                  {'status': 'check'}
              ]
              neo4j_proxy = Neo4jProxy(host='neo4j://example.com', port=0000)
              health_actual = neo4j_proxy.health()
              expected_checks = {'Neo4jProxy:connection': {'status': 'check', 'overview_enabled': True}}
              health_expected = health_check.HealthCheck(status='ok', checks=expected_checks)
              self.assertEqual(health_actual.status, health_expected.status)
              self.assertDictEqual(health_actual.checks, health_expected.checks)
  
          # Test health when the open source version is used
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              mock_execute.side_effect = ClientError()
              neo4j_proxy = Neo4jProxy(host='neo4j://example.com', port=0000)
              health_actual = neo4j_proxy.health()
              expected_checks = {'Neo4jProxy:connection': {'overview_enabled': False}}
              health_expected = health_check.HealthCheck(status='ok', checks=expected_checks)
              self.assertEqual(health_actual.status, health_expected.status)
              self.assertDictEqual(health_actual.checks, health_expected.checks)
  
          # Test health failure (e.g. any other error)
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              mock_execute.side_effect = Exception()
              health_actual = neo4j_proxy.health()
              expected_checks = {'Neo4jProxy:connection': {}}
              health_expected = health_check.HealthCheck(status='fail', checks=expected_checks)
              self.assertEqual(health_actual.status, health_expected.status)
              self.assertDictEqual(health_actual.checks, health_expected.checks)
  
      def test_get_table(self) -> None:
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              # mock database return values such that we match ordering of queries executed in Neo4jProxy.get_table
              mock_execute.side_effect = [
                  self.col_usage_return_value,
                  [],
                  self.owners_return_value,
                  self.table_level_return_value,
                  self.table_common_usage,
                  []
              ]
  
              neo4j_proxy = Neo4jProxy(host='neo4j://example.com', port=0000)
              table = neo4j_proxy.get_table(table_uri='dummy_uri')
  
              expected = Table(database='hive', cluster='gold', schema='foo_schema', name='foo_table',
                               tags=[Tag(tag_name='test', tag_type='default')],
                               badges=[Badge(badge_name='golden', category='table_status')],
                               table_readers=[], description='foo description',
                               watermarks=[Watermark(watermark_type='high_watermark',
                                                     partition_key='ds',
                                                     partition_value='fake_value',
                                                     create_time='fake_time'),
                                           Watermark(watermark_type='low_watermark',
                                                     partition_key='ds',
                                                     partition_value='fake_value',
                                                     create_time='fake_time')],
                               columns=[Column(name='bar_id_1', description='bar col description',
                                               col_type='array<struct<c1:string,c2:array<string>,'
                                                        'c3:map<string,string>,c4:struct<c5:int,c6:int>>>',
                                               sort_order=0, stats=[Stat(start_epoch=1,
                                                                         end_epoch=1,
                                                                         stat_type='avg',
                                                                         stat_val='1')], badges=[],
                                               type_metadata=self.col_bar_id_1_expected_type_metadata),
                                        Column(name='bar_id_2', description='bar col2 description',
                                               col_type='array<struct<c1:string,c2:array<string>>>',
                                               sort_order=1, stats=[Stat(start_epoch=2,
                                                                         end_epoch=2,
                                                                         stat_type='avg',
                                                                         stat_val='2')],
                                               badges=[Badge(badge_name='primary key', category='column')],
                                               type_metadata=self.col_bar_id_2_expected_type_metadata)],
                               owners=[User(email='tester@example.com', user_id='tester@example.com')],
                               table_writer=Application(**self.app_producing, kind='Producing'),
                               table_apps=[
                                   Application(**self.app_producing, kind='Producing'),
                                   Application(**self.app_consuming, kind='Consuming')
                               ],
                               last_updated_timestamp=1,
                               source=Source(source='/source_file_loc',
                                             source_type='github'),
                               is_view=False,
                               programmatic_descriptions=[
                                   ProgrammaticDescription(source='quality_report',
                                                           text='Test Test'),
                                   ProgrammaticDescription(source='s3_crawler',
                                                           text='Test Test Test')
                               ],
                               resource_reports=[
                                   ResourceReport(name='test_report', url='https://test.report/index.html')
                               ],
                               common_joins=[
                                   SqlJoin(
                                       join_sql=(
                                           'statewide_cases cases '
                                           'join statewide_testing tests on cases.newcountconfirmed <= tests.tested'
                                       ),
                                       join_type='inner join',
                                       joined_on_column='newcountconfirmed',
                                       joined_on_table=TableSummary(
                                           schema='open_data',
                                           cluster='ca_covid',
                                           database='snowflake',
                                           name='statewide_testing'
                                       ),
                                       column='newcountconfirmed'
                                   )
                               ],
                               common_filters=[
                                   SqlWhere(where_clause='b.countnewestcases <= 15')
                               ])
  
              self.assertEqual(str(expected), str(table))
  
      def test_get_table_view_only(self) -> None:
          col_usage_return_value = copy.deepcopy(self.col_usage_return_value)
          for col in col_usage_return_value:
              col['tbl']['is_view'] = True
  
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              mock_execute.side_effect = [
                  col_usage_return_value,
                  [],
                  self.owners_return_value,
                  self.table_level_return_value,
                  self.table_common_usage,
                  []
              ]
  
              neo4j_proxy = Neo4jProxy(host='neo4j://example.com', port=0000)
              table = neo4j_proxy.get_table(table_uri='dummy_uri')
  
              expected = Table(database='hive', cluster='gold', schema='foo_schema', name='foo_table',
                               tags=[Tag(tag_name='test', tag_type='default')],
                               badges=[Badge(badge_name='golden', category='table_status')],
                               table_readers=[], description='foo description',
                               watermarks=[Watermark(watermark_type='high_watermark',
                                                     partition_key='ds',
                                                     partition_value='fake_value',
                                                     create_time='fake_time'),
                                           Watermark(watermark_type='low_watermark',
                                                     partition_key='ds',
                                                     partition_value='fake_value',
                                                     create_time='fake_time')],
                               columns=[Column(name='bar_id_1', description='bar col description',
                                               col_type='array<struct<c1:string,c2:array<string>,'
                                                        'c3:map<string,string>,c4:struct<c5:int,c6:int>>>',
                                               sort_order=0, stats=[Stat(start_epoch=1,
                                                                         end_epoch=1,
                                                                         stat_type='avg',
                                                                         stat_val='1')], badges=[],
                                               type_metadata=self.col_bar_id_1_expected_type_metadata),
                                        Column(name='bar_id_2', description='bar col2 description',
                                               col_type='array<struct<c1:string,c2:array<string>>>',
                                               sort_order=1, stats=[Stat(start_epoch=2,
                                                                         end_epoch=2,
                                                                         stat_type='avg',
                                                                         stat_val='2')],
                                               badges=[Badge(badge_name='primary key', category='column')],
                                               type_metadata=self.col_bar_id_2_expected_type_metadata)],
                               owners=[User(email='tester@example.com', user_id='tester@example.com')],
                               table_writer=Application(**self.app_producing, kind='Producing'),
                               table_apps=[
                                   Application(**self.app_producing, kind='Producing'),
                                   Application(**self.app_consuming, kind='Consuming')
                               ],
                               last_updated_timestamp=1,
                               source=Source(source='/source_file_loc',
                                             source_type='github'),
                               is_view=True,
                               programmatic_descriptions=[
                                   ProgrammaticDescription(source='quality_report',
                                                           text='Test Test'),
                                   ProgrammaticDescription(source='s3_crawler',
                                                           text='Test Test Test')
                               ],
                               resource_reports=[
                                   ResourceReport(name='test_report', url='https://test.report/index.html')
                               ],
                               common_joins=[
                                   SqlJoin(
                                       join_sql=(
                                           'statewide_cases cases '
                                           'join statewide_testing tests on cases.newcountconfirmed <= tests.tested'
                                       ),
                                       join_type='inner join',
                                       joined_on_column='newcountconfirmed',
                                       joined_on_table=TableSummary(
                                           schema='open_data',
                                           cluster='ca_covid',
                                           database='snowflake',
                                           name='statewide_testing'
                                       ),
                                       column='newcountconfirmed'
                                   )
                               ],
                               common_filters=[
                                   SqlWhere(where_clause='b.countnewestcases <= 15')
                               ])
  
              self.assertEqual(str(expected), str(table))
  
      def test_get_table_with_valid_description(self) -> None:
          """
          Test description is returned for table
          :return:
          """
          with patch.object(GraphDatabase, 'driver'), patch.object(Neo4jProxy, '_execute_cypher_query') as mock_execute:
              mock_execute.return_value = [dict(description='sample description')]
  
              neo4j_proxy = Neo4jProxy(host='neo4j://example.com', port=0000)
              table_description = neo4j_proxy.get_table_description(table_uri='test_table')
  
  