Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DVX-591: Fixed interpretation of text-only indexed fields #373

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/asset/app.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _app:

App
===

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: App
:members:
10 changes: 10 additions & 0 deletions docs/asset/appapplication.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _appapplication:

AppApplication
==============

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: AppApplication
:members:
10 changes: 10 additions & 0 deletions docs/asset/appcomponent.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _appcomponent:

AppComponent
============

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: AppComponent
:members:
10 changes: 10 additions & 0 deletions docs/asset/dm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dm:

DM
==

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DM
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmattribute.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmattribute:

DMAttribute
===========

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMAttribute
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmattributeassociation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmattributeassociation:

DMAttributeAssociation
======================

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMAttributeAssociation
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmdatamodel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmdatamodel:

DMDataModel
===========

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMDataModel
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmentity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmentity:

DMEntity
========

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMEntity
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmentityassociation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmentityassociation:

DMEntityAssociation
===================

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMEntityAssociation
:members:
10 changes: 10 additions & 0 deletions docs/asset/dmversion.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dmversion:

DMVersion
=========

.. module:: pyatlan.model.assets
:no-index:

.. autoclass:: DMVersion
:members:
17 changes: 10 additions & 7 deletions docs/assets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ You can interact with all of the following different kinds of assets:
asset/airflow
asset/airflowdag
asset/airflowtask
asset/app
asset/appapplication
asset/appcomponent
asset/asset
asset/atlasglossary
asset/atlasglossarycategory
Expand Down Expand Up @@ -69,16 +72,16 @@ You can interact with all of the following different kinds of assets:
asset/cubedimension
asset/cubefield
asset/cubehierarchy
asset/dataattribute
asset/dataattributemappingprocess
asset/dm
asset/dmattribute
asset/dmattributeassociation
asset/dmdatamodel
asset/dmentity
asset/dmentityassociation
asset/dmversion
asset/datacontract
asset/datadomain
asset/dataentity
asset/dataentitymappingprocess
asset/datamesh
asset/datamodel
asset/datamodelversion
asset/datamodeling
asset/dataproduct
asset/dataquality
asset/dataset
Expand Down
4 changes: 4 additions & 0 deletions pyatlan/generator/class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ def get_default_index_for_type(base_type: str) -> IndexType:
to_use = IndexType.NUMERIC
elif base_type == "boolean":
to_use = IndexType.BOOLEAN
elif base_type == "string":
to_use = IndexType.TEXT
else:
to_use = IndexType.KEYWORD
return to_use
Expand Down Expand Up @@ -573,6 +575,8 @@ def get_indexes_for_attribute() -> Dict[IndexType, str]:
searchable[IndexType.STEMMED] = attr_name
else:
searchable[IndexType.TEXT] = attr_name
elif attr_def.get("indexType") == "STRING":
searchable[IndexType.KEYWORD] = attr_name
else:
def_index = get_default_index_for_type(base_type)
searchable[def_index] = attr_name
Expand Down
19 changes: 11 additions & 8 deletions pyatlan/model/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
"AuthPolicy",
"AtlasGlossaryTerm",
"BIProcess",
"DataAttributeMappingProcess",
"DataEntityMappingProcess",
"ColumnProcess",
"Persona",
"Folder",
"Airflow",
"DataContract",
"DataModeling",
"App",
"DataQuality",
"Resource",
"DataMesh",
Expand All @@ -36,10 +34,8 @@
"Stakeholder",
"AirflowDag",
"AirflowTask",
"DataModelVersion",
"DataModel",
"DataEntity",
"DataAttribute",
"AppApplication",
"AppComponent",
"MonteCarlo",
"Metric",
"Soda",
Expand All @@ -59,8 +55,8 @@
"Column",
"DatabricksUnityCatalogTag",
"SnowflakeStream",
"CalculationView",
"Database",
"CalculationView",
"Procedure",
"SnowflakeTag",
"MatillionGroup",
Expand Down Expand Up @@ -101,6 +97,7 @@
"object_store": ["ObjectStore"],
"b_i": ["BI"],
"saa_s": ["SaaS"],
"d_m": ["DM"],
"multi_dimensional_dataset": ["MultiDimensionalDataset"],
"event_store": ["EventStore"],
"no_s_q_l": ["NoSQL"],
Expand Down Expand Up @@ -134,6 +131,12 @@
"cognite": ["Cognite"],
"salesforce": ["Salesforce"],
"readme_template": ["ReadmeTemplate"],
"d_m_entity_association": ["DMEntityAssociation"],
"d_m_attribute": ["DMAttribute"],
"d_m_attribute_association": ["DMAttributeAssociation"],
"d_m_data_model": ["DMDataModel"],
"d_m_version": ["DMVersion"],
"d_m_entity": ["DMEntity"],
"cube": ["Cube"],
"cube_hierarchy": ["CubeHierarchy"],
"cube_field": ["CubeField"],
Expand Down
36 changes: 21 additions & 15 deletions pyatlan/model/assets/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ __all__ = [
"AuthPolicy",
"AtlasGlossaryTerm",
"BIProcess",
"DataAttributeMappingProcess",
"DataEntityMappingProcess",
"ColumnProcess",
"Persona",
"Folder",
"Airflow",
"DataContract",
"DataModeling",
"App",
"DataQuality",
"Resource",
"DataMesh",
Expand All @@ -33,10 +31,8 @@ __all__ = [
"Stakeholder",
"AirflowDag",
"AirflowTask",
"DataModelVersion",
"DataModel",
"DataEntity",
"DataAttribute",
"AppApplication",
"AppComponent",
"MonteCarlo",
"Metric",
"Soda",
Expand All @@ -56,8 +52,8 @@ __all__ = [
"Column",
"DatabricksUnityCatalogTag",
"SnowflakeStream",
"CalculationView",
"Database",
"CalculationView",
"Procedure",
"SnowflakeTag",
"MatillionGroup",
Expand Down Expand Up @@ -97,6 +93,7 @@ __all__ = [
"ObjectStore",
"BI",
"SaaS",
"DM",
"MultiDimensionalDataset",
"EventStore",
"NoSQL",
Expand Down Expand Up @@ -130,6 +127,12 @@ __all__ = [
"Cognite",
"Salesforce",
"ReadmeTemplate",
"DMEntityAssociation",
"DMAttribute",
"DMAttributeAssociation",
"DMDataModel",
"DMVersion",
"DMEntity",
"Cube",
"CubeHierarchy",
"CubeField",
Expand Down Expand Up @@ -321,6 +324,9 @@ from .core.access_control import AccessControl
from .core.airflow import Airflow
from .core.airflow_dag import AirflowDag
from .core.airflow_task import AirflowTask
from .core.app import App
from .core.app_application import AppApplication
from .core.app_component import AppComponent
from .core.asset import Asset
from .core.atlas_glossary import AtlasGlossary
from .core.atlas_glossary_category import AtlasGlossaryCategory
Expand All @@ -331,16 +337,9 @@ from .core.calculation_view import CalculationView
from .core.catalog import Catalog
from .core.column import Column
from .core.column_process import ColumnProcess
from .core.data_attribute import DataAttribute
from .core.data_attribute_mapping_process import DataAttributeMappingProcess
from .core.data_contract import DataContract
from .core.data_domain import DataDomain
from .core.data_entity import DataEntity
from .core.data_entity_mapping_process import DataEntityMappingProcess
from .core.data_mesh import DataMesh
from .core.data_model import DataModel
from .core.data_model_version import DataModelVersion
from .core.data_modeling import DataModeling
from .core.data_product import DataProduct
from .core.data_quality import DataQuality
from .core.database import Database
Expand Down Expand Up @@ -399,6 +398,13 @@ from .cube import Cube
from .cube_dimension import CubeDimension
from .cube_field import CubeField
from .cube_hierarchy import CubeHierarchy
from .d_m import DM
from .d_m_attribute import DMAttribute
from .d_m_attribute_association import DMAttributeAssociation
from .d_m_data_model import DMDataModel
from .d_m_entity import DMEntity
from .d_m_entity_association import DMEntityAssociation
from .d_m_version import DMVersion
from .data_set import DataSet
from .data_studio import DataStudio
from .data_studio_asset import DataStudioAsset
Expand Down
11 changes: 8 additions & 3 deletions pyatlan/model/assets/business_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

from pydantic.v1 import Field, validator

from pyatlan.model.fields.atlan_fields import KeywordField, NumericField, RelationField
from pyatlan.model.fields.atlan_fields import (
KeywordField,
NumericField,
RelationField,
TextField,
)

from .core.asset import Asset

Expand Down Expand Up @@ -66,7 +71,7 @@ def __setattr__(self, name, value):
"""
Duration for the business policy to complete review.
"""
BUSINESS_POLICY_FILTER_DSL: ClassVar[KeywordField] = KeywordField(
BUSINESS_POLICY_FILTER_DSL: ClassVar[TextField] = TextField(
"businessPolicyFilterDSL", "businessPolicyFilterDSL"
)
"""
Expand All @@ -78,7 +83,7 @@ def __setattr__(self, name, value):
"""
Base parent Guid for policy used in version
"""
BUSINESS_POLICY_SELECTED_APPROVAL_WF: ClassVar[KeywordField] = KeywordField(
BUSINESS_POLICY_SELECTED_APPROVAL_WF: ClassVar[TextField] = TextField(
"businessPolicySelectedApprovalWF", "businessPolicySelectedApprovalWF"
)
"""
Expand Down
3 changes: 2 additions & 1 deletion pyatlan/model/assets/business_policy_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
KeywordField,
KeywordTextField,
RelationField,
TextField,
)

from .core.asset import Asset
Expand Down Expand Up @@ -53,7 +54,7 @@ def __setattr__(self, name, value):
"""
Unique name of the business policy through which this asset is accessible.
"""
BUSINESS_POLICY_EXCEPTION_FILTER_DSL: ClassVar[KeywordField] = KeywordField(
BUSINESS_POLICY_EXCEPTION_FILTER_DSL: ClassVar[TextField] = TextField(
"businessPolicyExceptionFilterDSL", "businessPolicyExceptionFilterDSL"
)
"""
Expand Down
4 changes: 2 additions & 2 deletions pyatlan/model/assets/business_policy_incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pydantic.v1 import Field, validator

from pyatlan.model.fields.atlan_fields import KeywordField, NumericField
from pyatlan.model.fields.atlan_fields import KeywordField, NumericField, TextField

from .incident import Incident

Expand Down Expand Up @@ -45,7 +45,7 @@ def __setattr__(self, name, value):
"""
policy ids related to this incident
"""
BUSINESS_POLICY_INCIDENT_FILTER_DSL: ClassVar[KeywordField] = KeywordField(
BUSINESS_POLICY_INCIDENT_FILTER_DSL: ClassVar[TextField] = TextField(
"businessPolicyIncidentFilterDSL", "businessPolicyIncidentFilterDSL"
)
"""
Expand Down
Loading
Loading