GithubHelp home page GithubHelp logo

[BUG]ModuleNotFoundError: No module named 'db_libs' [contrib里面是作者额外贡献的功能,需要用户自己安装相关三方包] about funboost HOT 3 CLOSED

anjia0532 avatar anjia0532 commented on September 22, 2024
[BUG]ModuleNotFoundError: No module named 'db_libs' [contrib里面是作者额外贡献的功能,需要用户自己安装相关三方包]

from funboost.

Comments (3)

ydf0509 avatar ydf0509 commented on September 22, 2024

这个包也是本人发明的,需要用户自己pip install db_libs

你用到contrib文件夹下的东西,contrib意思是额外的贡献,contrib的东西这是和框架主流程无关的,所以需要用户自己安装啊

99%的人不会用到 funboost/funboost/contrib/save_result_status_to_sqldb.py ,如果funboost安装时候是自动安装db_libs了, 有的人又要在那里呱呱叫,又抱怨说安装本人的全家桶,

from funboost.

anjia0532 avatar anjia0532 commented on September 22, 2024

非常感谢,引入 db_libs 后还有两个小问题,不过已经解决了。

  1. pymysql 如果用最新的 1.1.0 会提示 AttributeError: module 'MySQLdb.constants' has no attribute 'FLAG' 降级到 0.7.7 可以了 (其他主要包及版本如下 funboost==42.9,sqlalchemy==2.0.28,pymysql==0.7.7,db_libs==0.9)
  2. 按照
    """
    -- 如果用户是先保存到mysql中而非mongodb,用户自己先创建表,用于保存函数消费状态和结果.
    CREATE TABLE funboost_consume_results
    (
    _id VARCHAR(255),
    `function` VARCHAR(255),
    host_name VARCHAR(255),
    host_process VARCHAR(255),
    insert_minutes VARCHAR(255),
    insert_time datetime,
    insert_time_str VARCHAR(255),
    msg_dict JSON,
    params JSON,
    params_str VARCHAR(255),
    process_id BIGINT(20),
    publish_time FLOAT,
    publish_time_str VARCHAR(255),
    queue_name VARCHAR(255),
    result VARCHAR(255),
    run_times INT,
    script_name VARCHAR(255),
    script_name_long VARCHAR(255),
    success BOOLEAN,
    task_id VARCHAR(255),
    thread_id BIGINT(20),
    time_cost FLOAT,
    time_end FLOAT,
    time_start FLOAT,
    total_thread INT,
    utime VARCHAR(255),
    `exception` MEDIUMTEXT ,
    rpc_result_expire_seconds BIGINT(20),
    primary key (_id),
    key idx_insert_time(insert_time),
    key idx_queue_name_insert_time(queue_name,insert_time),
    key idx_params_str(params_str)
    )
    """
    的建表语句,会提示缺少 run_status ,执行 ALTER TABLE funboost_consume_results ADD COLUMN run_status varchar(255) NULL AFTER run_times;

from funboost.

ydf0509 avatar ydf0509 commented on September 22, 2024

是的,因为是后来新加的字段run_status

from funboost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.