Page 1 of 1

Who thinks it's worth specifying which parameters to pass values to?

Posted: Fri Sep 16, 2022 4:40 pm
by sergei721

Code: Select all

        @staticmethod
            def _create_table(
                columns: str,
                primary_key: str,
                hash_id: str,
            ) -> str:
                sql = """CREATE TABLE ..."""
                return sql


In your opinion, is it worth specifying parameters to which values are passed (if the names of variables and parameters match)?

One of the colleagues says that it is necessary to call as for sql_create_rw.
Which call option would you choose sql_create or sql_create_rw(the method is called 1 time)?


Code: Select all

    def check_qa(
                table_name: str,
                segment: str,
                columns: str,
                primary_key: str,
                hash_id: str,
            ) -> str:
                sql_create = self._create_table(columns, primary_key, hash_id)
                sql_create_rw = self._create_table(columns=columns, primary_key=primary_key, hash_id=hash_id)

Re: Who thinks it's worth specifying which parameters to pass values to?

Posted: Sun Sep 18, 2022 4:56 pm
by Articha
Zero context information. What class is it? What library are used? SQLite3? SQLAlchemy?