erezsh / sqeleton

A python library for efficiently interacting and querying SQL databases
MIT License
20 stars 4 forks source link

Warning Appears When Using order_by Method #25

Closed zhangbc97 closed 1 month ago

zhangbc97 commented 1 month ago

Description: I encountered a warning while using the order_by method in the sqeleton library. Below are the details of the warning and steps to reproduce it.

Warning Message: site-packages\runtype\dataclass.py:216: DeprecationWarning: This method is deprecated and will be removed in future versions.Please use `.asdict()` or `.asitems()` instead.

Environment:

Python Version: 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)] sqeleton Version: 0.1.6 Operating System: Windows 11

Code to Reproduce:

import sys
import traceback
import warnings

from sqeleton import table, this

warnings.resetwarnings()

# def warn_with_traceback(message, category, filename, lineno, file=None, line=None):

#     log = file if hasattr(file, 'write') else sys.stderr
#     traceback.print_stack(file=log)
#     log.write(warnings.formatwarning(message, category, filename, lineno, line))

# warnings.showwarning = warn_with_traceback

def main():
    query = table('test_table').select().order_by(this.test_column)

if __name__ == '__main__':
    main()
erezsh commented 1 month ago

Should be fixed in the latest master.

Thanks for reporting!