<commit_before># Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try:
    import unittest2 as unittest
except ImportError:
    import unittest  # noqa

from collections import namedtuple, OrderedDict

from cassandra import ProtocolVersion
from cassandra.cluster import Cluster, EXEC_PROFILE_DEFAULT
from cassandra.query import (named_tuple_factory, tuple_factory,
                             dict_factory, ordered_dict_factory)

from cassandra.cqlengine import columns
from cassandra.cqlengine.connection import set_session
from cassandra.cqlengine.models import Model

from tests.integration import PROTOCOL_VERSION, requiressimulacron
from tests.integration.simulacron import SimulacronCluster
from tests.integration.simulacron.utils import PrimeQuery, prime_request


PROTOCOL_VERSION = 4 if PROTOCOL_VERSION in \
    (ProtocolVersion.DSE_V1, ProtocolVersion.DSE_V2) else PROTOCOL_VERSION


@requiressimulacron
class EmptyColumnTests(SimulacronCluster):
    """
    Test that legacy empty column names can be read by the driver.

    @since 3.18
    @jira_ticket PYTHON-1082
    @expected_result the driver supports those columns
    """<commit_msg>make sure simulacron/test_empty_column uses protocolv4<commit_after># Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try:
    import unittest2 as unittest
except ImportError:
    import unittest  # noqa

from collections import namedtuple, OrderedDict

from cassandra import ProtocolVersion
from cassandra.cluster import Cluster, EXEC_PROFILE_DEFAULT
from cassandra.query import (named_tuple_factory, tuple_factory,
                             dict_factory, ordered_dict_factory)

from cassandra.cqlengine import columns
from cassandra.cqlengine.connection import set_session
from cassandra.cqlengine.models import Model

from tests.integration import requiressimulacron
from tests.integration.simulacron import PROTOCOL_VERSION, SimulacronCluster
from tests.integration.simulacron.utils import PrimeQuery, prime_request


PROTOCOL_VERSION = 4 if PROTOCOL_VERSION in \
    (ProtocolVersion.DSE_V1, ProtocolVersion.DSE_V2) else PROTOCOL_VERSION


@requiressimulacron
class EmptyColumnTests(SimulacronCluster):
    """
    Test that legacy empty column names can be read by the driver.

    @since 3.18
    @jira_ticket PYTHON-1082
    @expected_result the driver supports those columns
    """
{'fraction_non_alphanumeric': 0.0534711964549483, 'fraction_numerical': 0.009158050221565732, 'mean_word_length': 4.662207357859532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994355', 'n_tokens_mistral': 954, 'n_tokens_neox': 919, 'n_words': 350}