How to use the pymssql.NUMBER function in pymssql

To help you get started, we’ve selected a few pymssql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github biolab / orange3 / Orange / data / sql / backend / mssql.py View on Github external
def _guess_variable(self, field_name, field_metadata, inspect_table):
        # pylint: disable=import-error
        from pymssql import STRING, NUMBER, DATETIME, DECIMAL

        type_code, *_ = field_metadata

        if type_code in (NUMBER, DECIMAL):
            return ContinuousVariable(field_name)

        if type_code == DATETIME:
            tv = TimeVariable(field_name)
            tv.have_date = True
            tv.have_time = True
            return tv

        if type_code == STRING:
            if inspect_table:
                values = self.get_distinct_values(field_name, inspect_table)
                if values:
                    return DiscreteVariable(field_name, values)

        return StringVariable(field_name)
github apache / airflow / airflow / operators / mssql_to_hive.py View on Github external
def type_map(cls, mssql_type: int) -> str:
        """
        Maps MsSQL type to Hive type.
        """
        map_dict = {
            pymssql.BINARY.value: 'INT',  # pylint: disable=c-extension-no-member
            pymssql.DECIMAL.value: 'FLOAT',  # pylint: disable=c-extension-no-member
            pymssql.NUMBER.value: 'INT',  # pylint: disable=c-extension-no-member
        }
        return map_dict.get(mssql_type, 'STRING')