python ast.literal_eval()值错误:节点或字符串格式不正确

lrl1mhuk  于 2022-12-28  发布在  Python
关注(0)|答案(1)|浏览(225)

我有一个blob作为文本下载(从GCP存储;见下文),赋值给变量metafile

metafile = "{'account': {'last_query_time': '2022-12-27T21:53:17Z', 'fields': OrderedDict([('Id', 'id'), ('IsDeleted', 'boolean'), ('MasterRecordId', 'reference'), ('Name', 'string'), ('Type', 'picklist'), ('ParentId', 'reference'), ('BillingStreet', 'textarea'), ('BillingCity', 'string'), ('BillingState', 'string'), ('BillingPostalCode', 'string'), ('BillingCountry', 'string'), ('BillingLatitude', 'double'), ('BillingLongitude', 'double'), ('BillingGeocodeAccuracy', 'picklist'), ('ShippingStreet', 'textarea'), ('ShippingCity', 'string'), ('ShippingState', 'string'), ('ShippingPostalCode', 'string'), ('ShippingCountry', 'string'), ('ShippingLatitude', 'double'), ('ShippingLongitude', 'double'), ('ShippingGeocodeAccuracy', 'picklist'), ('Phone', 'phone'), ('Fax', 'phone'), ('Website', 'url'), ('PhotoUrl', 'url'), ('Sic', 'string'), ('AnnualRevenue', 'currency'), ('NumberOfEmployees', 'int'), ('Description', 'textarea'), ('Rating', 'picklist'), ('OwnerId', 'reference'), ('CreatedDate', 'datetime'), ('CreatedById', 'reference'), ('LastModifiedDate', 'datetime'), ('LastModifiedById', 'reference'), ('SystemModstamp', 'datetime'), ('LastActivityDate', 'date'), ('LastViewedDate', 'datetime'), ('LastReferencedDate', 'datetime'), ('JigsawCompanyId', 'string'), ('ConnectionReceivedId', 'reference'), ('ConnectionSentId', 'reference'), ('ActivityMetricId', 'reference'), ('ActivityMetricRollupId', 'reference'), ('Total_Potential_Buildings_on_campus__c', 'double'), ('Billing_Phone__c', 'phone'), ('Account_Nickname__c', 'string'), ('Number_of_Opps_on_Account__c', 'double'), ('Notes_about_account__c', 'textarea'), ('Customer_Success_Health__c', 'picklist'), ('BDN_URL__c', 'textarea'), ('BDK_URL__c', 'textarea'), ('LeanData__LD_EmailDomain__c', 'string'), ('Number_of_Open_Opportunities__c', 'double'), ('Customer_Success_Last_Updated__c', 'date'), ('Portal_Dashboard_Login__c', 'textarea'), ('LeanData__Search__c', 'string'), ('LeanData__Tag__c', 'string'), ('Hidden_Checkbox__c', 'boolean'), ('Background__c', 'textarea'), ('Next_Steps__c', 'textarea'), ('CRE_Target_Account__c', 'boolean'), ('Target_Account_2016__c', 'boolean'), ('Customer_Success_Health_Score__c', 'double'), ('Total_Potential_Sq_Footage__c', 'double'), ('Competitions__c', 'multipicklist'), ('Customer_Since__c', 'date'), ('Account_Owner_text__c', 'string'), ('Total_Revenue_Received_from_Customer__c', 'currency'), ('Public_Usage_of_Name__c', 'picklist'), ('Up_sell_Opps__c', 'textarea'), ('Number_of_Won_Oppos__c', 'double'), ('Upsell_potential__c', 'picklist'), ('Squirrel_Fish_Activated__c', 'boolean'), ('Customer_Priority_Score__c', 'double'), ('Customer_Success_Type__c', 'picklist'), ('Do_not_index_BDK__c', 'boolean'), ('Has_Kiosk_On_Site_Exchange__c', 'boolean'), ('Building_Name__c', 'string'), ('Outstanding_Work__c', 'textarea'), ('Integration_Engineer__c', 'reference'), ('Building_Owner__c', 'string'), ('Year_Built__c', 'double'), ('Competitor_With__c', 'multipicklist'), ('Competitive_Notes__c', 'string'), ('Industry__c', 'picklist'), ('Sub_Industry__c', 'picklist'), ('State_University_Reference_Customer__c', 'string'), ('Potential_Upsell_Buildings__c', 'double'), ('Support_Case__c', 'string'), ('Account_Count__c', 'double'), ('Domain_C__c', 'string'), ('Account_ID_18_characters__c', 'string'), ('Fortune_500_Rank__c', 'double'), ('Global_2000_Rank__c', 'double'), ('Annual_Electricity_Spend__c', 'currency'), ('Annual_EE_Budget__c', 'currency'), ('Support_Date_Opened__c', 'datetime'), ('Number_of_Employees_Site__c', 'double'), ('Number_of_Subscriptions__c', 'double'), ('First_Subscription_End_Date__c', 'date'), ('Total_Subscription_Revenue__c', 'currency'), ('Number_of_Active_Subscriptions__c', 'double'), ('Number_of_Inactive_Subscriptions__c', 'double'), ('Customer_Type__c', 'string'), ('Net_Annual_Revenue__c', 'currency'), ('Latest_Subscription_End_Date__c', 'date'), ('Business_Relationship__c', 'picklist'), ('Customer_Success_Manager__c', 'reference'), ('Fortune_1000_Company__c', 'picklist'), ('Number_of_Employees_Global__c', 'double'), ('Customer_Status_Update__c', 'textarea'), ('Support_Case_Id__c', 'string'), ('Days_as_Inactive_Customer__c', 'double'), ('reference_customer__c', 'picklist'), ('BDN__c', 'boolean'), ('BDK__c', 'boolean'), ('OSR__c', 'picklist'), ('Support_Case_Link__c', 'string'), ('Test_Box__c', 'boolean'), ('BuildingOS__c', 'boolean'), ('Territory__c', 'string'), ('Enterprise_Named_Account__c', 'boolean'), ('Vertical__c', 'picklist'), ('Sub_Vertical__c', 'picklist'), ('Latest_Subscription_End_Date_2__c', 'date'), ('zisf__ZoomInfo_Industry__c', 'string'), ('zisf__zoom_id__c', 'string'), ('zisf__zoom_lastupdated__c', 'datetime'), ('Priority_Level__c', 'picklist'), ('Open_Upsells__c', 'double'), ('LID__LinkedIn_Company_Id__c', 'string'), ('Number_of_Contacts_in_Sequence__c', 'double'), ('Territory_Text__c', 'string'), ('Ultimate_Parent__c', 'string'), ('Account_Score__c', 'double'), ('Number_of_Open_Renewal_Opportunities__c', 'double'), ('Territory_Hidden__c', 'string'), ('Target_Account_Sustainability_Goals__c', 'textarea'), ('Lucid_Sourced_Kiosk_Hardware__c', 'picklist'), ('Lucid_Sourced_Kiosk_Hardware_Notes__c', 'textarea'), ('Sent_Porteus_Kiosk__c', 'boolean'), ('Porteus_Kiosk_Notes__c', 'textarea'), ('Periscope_Engagement_Dashboard__c', 'url'), ('Jira_Board__c', 'url'), ('Account_Manager__c', 'reference'), ('Price_Discount__c', 'picklist'), ('Purchasing_Type__c', 'multipicklist'), ('Partner_Tier__c', 'picklist'), ('DGLux_Business_Relationship__c', 'picklist'), ('Latest_Oppty_Won_Date__c', 'date'), ('Latest_Oppty_Won_Id__c', 'string'), ('DGLux_Customer__c', 'string'), ('Is_DGLux_Imported__c', 'boolean'), ('OLD_Account_ID__c', 'string'), ('Assessment__c', 'boolean'), ('Assessment_Start_Date__c', 'date'), ('AP_Billing_Email__c', 'string'), ('Latest_Won_Opp_Close_Date__c', 'date'), ('Strategic_Account__c', 'boolean'), ('Exclude_Marketing__c', 'boolean'), ('Exclude_Licensing_Data__c', 'boolean'), ('Easy_Upsell__c', 'textarea'), ('X10x_Upsell__c', 'textarea'), ('Acuity_National_Act__c', 'boolean'), ('Total_Active_Buildings_in_BOS__c', 'double'), ('X2020_Customer_Upsell_Campaign__c', 'picklist'), ('DSCORGPKG__DO_3yr_Employees_Growth__c', 'string'), ('DSCORGPKG__DO_3yr_Sales_Growth__c', 'string'), ('DSCORGPKG__DeletedFromDiscoverOrg__c', 'picklist'), ('DSCORGPKG__DiscoverOrg_Created_On__c', 'datetime'), ('DSCORGPKG__DiscoverOrg_First_Update__c', 'datetime'), ('DSCORGPKG__DiscoverOrg_FullCountryName__c', 'string'), ('DSCORGPKG__DiscoverOrg_ID__c', 'string'), ('DSCORGPKG__DiscoverOrg_LastUpdate__c', 'datetime'), ('DSCORGPKG__DiscoverOrg_State_Full_Name__c', 'string'), ('DSCORGPKG__External_DiscoverOrg_Id__c', 'string'), ('DSCORGPKG__Fiscal_Year_End__c', 'string'), ('DSCORGPKG__ITOrgChart__c', 'string'), ('DSCORGPKG__IT_Budget__c', 'double'), ('DSCORGPKG__IT_Employees__c', 'double'), ('DSCORGPKG__Lead_Source__c', 'picklist'), ('DSCORGPKG__NAICS_Codes__c', 'string'), ('DSCORGPKG__Ownership__c', 'string'), ('DSCORGPKG__SIC_Codes__c', 'string'), ('zisf__ZoomInfo_Complete_Status__c', 'string'), ('zisf__ZoomInfo_Last_Clean_Run__c', 'datetime'), ('zisf__Zoom_Clean_Status__c', 'picklist'), ('Acuity_Account_Notes__c', 'textarea'), ('Date_Sourced__c', 'date'), ('saasoptics__arr_at_end_of_month__c', 'currency'), ('saasoptics__arr_of_prior_month__c', 'currency'), ('saasoptics__e_invoice_billing_profile__c', 'url'), ('saasoptics__mrr_at_end_of_month__c', 'currency'), ('saasoptics__mrr_of_prior_month__c', 'currency'), ('saasoptics__next_invoice_amount__c', 'currency'), ('saasoptics__next_invoice_date__c', 'date'), ('saasoptics__next_invoice_due_date__c', 'date'), ('saasoptics__next_invoice_hyperlink_e_invoice__c', 'url'), ('saasoptics__next_invoice_hyperlink_saasoptics__c', 'url'), ('saasoptics__total_invoice_balance__c', 'currency'), ('saasoptics__total_invoice_balance_prior_month__c', 'currency'), ('zisf__Company_ID__c', 'string'), ('Pilot__c', 'boolean'), ('Customer_Type1__c', 'string'), ('saasoptics__customer_status__c', 'string'), ('Business_Unit__c', 'multipicklist'), ('DGLux_Account_Type__c', 'picklist'), ('AVA_MAPPER__Business_Identification_Number__c', 'string'), ('AVA_MAPPER__Entity_Use_code__c', 'reference'), ('AVA_MAPPER__Exemption_Number__c', 'string'), ('AVA_MAPPER__Is_Seller_Importer_Of_Record__c', 'boolean'), ('AVA_SFCPQ__AvaTaxCustomerStatus__c', 'string'), ('AVA_SFCPQ__AvaTaxMessage__c', 'textarea'), ('AVA_SFCPQ__AvaTax_Exemption_Customer_ID__c', 'string'), ('AVA_SFCPQ__Business_Identification_Number__c', 'string'), ('AVA_SFCPQ__Email__c', 'email'), ('AVA_SFCPQ__ExemptEntityType__c', 'reference'), ('AVA_SFCPQ__Is_Seller_Importer_Of_Record__c', 'boolean'), ('AVA_SFCPQ__TaxExemptionCode__c', 'string'), ('LocusLabs_Customer__c', 'string'), ('Customer_Success_Health_Reason__c', 'picklist'), ('Core_Use_Case__c', 'boolean'), ('Number_of_Open_Renewal_Opportunities_Loc__c', 'double'), ('Business_Unit_BOS__c', 'string'), ('Business_Unit_LocusLabs__c', 'string'), ('Business_Unit_Atrius__c', 'string'), ('Business_Unit_DGLux__c', 'string'), ('Business_Unit_Other__c', 'string'), ('Customer_Old__c', 'string'), ('saasoptics__saasoptics_total_invoice_li_amount__c', 'currency'), ('saasoptics__saasoptics_total_revenue_scheduled__c', 'currency'), ('saasoptics__saasoptics_total_transactions_amount__c', 'currency'), ('saasoptics__closed_won_opp_count__c', 'double'), ('FY_Start__c', 'date'), ('FY_End_Date__c', 'date'), ('Client_Goals__c', 'textarea'), ('Product_Interests__c', 'textarea'), ('Priority_Airports__c', 'textarea'), ('Risks__c', 'textarea'), ('Account_KPI_s__c', 'textarea'), ('Primary_Contact__c', 'reference'), ('Pricing_Notes__c', 'textarea'), ('Account_Tier__c', 'picklist'), ('Atrius_Customer__c', 'string'), ('Do_NOT_Sync_Pardot_Account__c', 'boolean'), ('Do_Not_Send_CSAT__c', 'boolean'), ('Vender_Invoice_Login_Info__c', 'textarea'), ('Renewal_Email_Type__c', 'picklist'), ('Renewal_Term__c', 'double'), ('Non_Renewal_Notice__c', 'picklist'), ('Annual_Price_Adjustment__c', 'picklist'), ('Payment_Method__c', 'picklist'), ('Implementation_Hardware_Terms__c', 'picklist'), ('Software_Terms__c', 'picklist'), ('Invoice_Amount__c', 'picklist'), ('Billing_Frequency__c', 'picklist'), ('Billing_Method__c', 'picklist'), ('ACC_Update__c', 'boolean'), ('Business_Unit_formula__c', 'string'), ('Opp_Business_Unit_BuildingOS__c', 'double'), ('accountIntentScore6sense__c', 'double'), ('accountProfileScore6sense__c', 'double'), ('accountReachScore6sense__c', 'textarea'), ('accountBuyingStage6sense__c', 'textarea'), ('accountUpdateDate6sense__c', 'datetime'), ('Signed_Distech_Reseller_Agreement__c', 'boolean'), ('Internal_Escalation_Emails__c', 'textarea'), ('Account_Type__c', 'picklist'), ('saasoptics__chargify_id__c', 'string'), ('saasoptics__chargify_url__c', 'url')])}, 'opportunity': {'last_query_time': '2022-12-27T21:54:15Z', 'fields': OrderedDict([('Id', 'id'), ('IsDeleted', 'boolean'), ('AccountId', 'reference'), ('RecordTypeId', 'reference'), ('Name', 'string'), ('Description', 'textarea'), ('StageName', 'picklist'), ('Amount', 'currency'), ('Probability', 'percent'), ('ExpectedRevenue', 'currency'), ('CloseDate', 'date'), ('Type', 'picklist'), ('LeadSource', 'picklist'), ('IsClosed', 'boolean'), ('IsWon', 'boolean'), ('ForecastCategory', 'picklist'), ('ForecastCategoryName', 'picklist'), ('CampaignId', 'reference'), ('HasOpportunityLineItem', 'boolean'), ('IsSplit', 'boolean'), ('Pricebook2Id', 'reference'), ('OwnerId', 'reference'), ('Territory2Id', 'reference'), ('IsExcludedFromTerritory2Filter', 'boolean'), ('CreatedDate', 'datetime'), ('CreatedById', 'reference'), ('LastModifiedDate', 'datetime'), ('LastModifiedById', 'reference'), ('SystemModstamp', 'datetime'), ('LastActivityDate', 'date'), ('FiscalQuarter', 'int'), ('FiscalYear', 'int'), ('Fiscal', 'string'), ('LastViewedDate', 'datetime'), ('LastReferencedDate', 'datetime'), ('ConnectionReceivedId', 'reference'), ('ConnectionSentId', 'reference'), ('SyncedQuoteId', 'reference'), ('HasOpenActivity', 'boolean'), ('HasOverdueTask', 'boolean'), ('ActivityMetricId', 'reference'), ('ActivityMetricRollupId', 'reference'), ('Method_of_Billing__c', 'picklist'), ('CFCR_Velocity_Won__c', 'double'), ('First_Invoice__c', 'currency'), ('Number_of_Buildings__c', 'double'), ('Channel_Partner__c', 'reference'), ('Super_Partner__c', 'string'), ('Billing_Attention__c', 'string'), ('Reason_for_Loss__c', 'picklist'), ('Billing_Address__c', 'textarea'), ('Billing_City__c', 'string'), ('Billing_State__c', 'string'), ('Billing_Country__c', 'string'), ('Billing_Terms__c', 'picklist'), ('Sales_Engineer__c', 'picklist'), ('Annual_Service_Fee__c', 'currency'), ('Third__c', 'currency'), ('Special_Billing_Terms__c', 'textarea'), ('SO_Rev_Rec_Total_Hardware_Services__c', 'currency'), ('Commission_ACV__c', 'currency'), ('Accounting_Notes__c', 'textarea'), ('Expected_Completion_Date__c', 'date'), ('Billing_Email__c', 'string'), ('SO_Rev_Rec_ESP_Calc_Total__c', 'currency'), ('Resold_Licenses__c', 'double'), ('Shipping_Phone__c', 'phone'), ('Integration_Notes__c', 'textarea'), ('Google_Search_Keywords_used__c', 'textarea'), ('SO_Revenue_Amount__c', 'currency'), ('Hardware__c', 'string'), ('Revenue_Check_Rev_Contract_Amount__c', 'currency'), ('Economic_Buyer__c', 'textarea'), ('Referred_By__c', 'string'), ('Prepaid_Subscription_Fees__c', 'currency'), ('Inside_Sales_Involvement__c', 'boolean'), ('Project__c', 'reference'), ('Competitive_Notes__c', 'string'), ('Competitor__c', 'multipicklist'), ('FOB__c', 'picklist'), ('Inside_Sales_Representative__c', 'picklist'), ('Proposal_Presented_Date__c', 'date'), ('New_Lost_To__c', 'multipicklist'), ('Standard_ICA__c', 'picklist'), ('Assignability__c', 'picklist'), ('Shipping_Attention_and_Address__c', 'textarea'), ('Next_Steps__c', 'textarea'), ('Service_Level_Agreement__c', 'textarea'), ('Finance_Approved__c', 'boolean'), ('Win_Loss_Reason__c', 'string'), ('Created_Date_No_Time__c', 'date'), ('Payment_Terms__c', 'picklist'), ('Dashboard_Project_Stage__c', 'picklist'), ('of_Free_Months__c', 'double'), ('Annual_Subscription_Fees_Rollup_Old__c', 'currency'), ('Implementation_Fees__c', 'currency'), ('Building_Names__c', 'textarea'), ('Hardware_Fees__c', 'currency'), ('Credits__c', 'currency'), ('New_Setup_and_Integration_Total__c', 'currency'), ('Calculated_Bookings__c', 'currency'), ('Total_SP_Amount__c', 'currency'), ('SP_Description__c', 'textarea'), ('Amount_with_Tax_and_Shipping__c', 'currency'), ('Years_of_Paid_Service__c', 'double'), ('Billing_Phone__c', 'phone'), ('Opportunity_Type__c', 'picklist'), ('New_Hardware_Subtotal__c', 'currency'), ('Quote_Buildings__c', 'double'), ('New_Hardware_Total__c', 'currency'), ('New_Sales_Tax__c', 'currency'), ('New_Shipping__c', 'currency'), ('New_Grand_Total__c', 'currency'), ('SaaS__c', 'percent'), ('Original_Project_Owner__c', 'reference'), ('New_System_Type__c', 'multipicklist'), ('Existing_Subscription_Credit__c', 'currency'), ('New_Subscription_Term_Discount__c', 'currency'), ('New_Subscription_Total__c', 'currency'), ('New_Protocol__c', 'multipicklist'), ('Opportunity_Won__c', 'double'), ('Opportunity_Lost__c', 'double'), ('Reason_for_Win_Description__c', 'textarea'), ('Quote_Term_Old__c', 'double'), ('BldgOS_Setup_and_Integration_Subtotal__c', 'currency'), ('Adjusted_Prepaid_Amount__c', 'currency'), ('New_RFP__c', 'picklist'), ('Previous_Annual_Subscription__c', 'currency'), ('Does_Bookings_match_Adjusted_Bookings__c', 'string'), ('Subscription_Upsell_Amount__c', 'currency'), ('Subscription_Term_years__c', 'double'), ('ToutApp__Tout_Last_Activity__c', 'datetime'), ('Building_Dashboard_Setup_Subtotal__c', 'currency'), ('ToutApp__Tout_Last_Engagement__c', 'datetime'), ('Setup_Integration_Discount__c', 'currency'), ('Opportunity_ID_18_characters__c', 'string'), ('BuildingOS_Type__c', 'multipicklist'), ('Add_On_Subscriptions__c', 'multipicklist'), ('Opportunity_Count__c', 'double'), ('Hardware_Discount__c', 'currency'), ('Consulting_Development_Amount__c', 'currency'), ('Lead_Source_Detail__c', 'picklist'), ('Parent_Opportunity__c', 'reference'), ('Payment_Date_1__c', 'date'), ('Upsell__c', 'boolean'), ('CreatedDate_2__c', 'datetime'), ('ALC_RSM__c', 'picklist'), ('Additional_Subscription_Discounts__c', 'currency'), ('Subscription__c', 'reference'), ('Reason_for_Win__c', 'picklist'), ('Reason_for_Win_Details__c', 'picklist'), ('Reason_for_Loss_Details__c', 'picklist'), ('Age_2__c', 'double'), ('Hardware_Credit__c', 'currency'), ('Setup_Integration_Credit__c', 'currency'), ('TCV_per_Building__c', 'currency'), ('Total_Number_of_Buildings__c', 'double'), ('Pricing_Model__c', 'picklist'), ('LID__Is_Influenced__c', 'boolean'), ('ToutApp__Tout_Last_Replied__c', 'datetime'), ('Challenges__c', 'textarea'), ('Additional_Need__c', 'picklist'), ('Importance_of_Additional_Needs__c', 'picklist'), ('Reason_for_Loss_Description__c', 'textarea'), ('House__c', 'textarea'), ('Reason_for_Historic_Record_Type__c', 'multipicklist'), ('Subscription_Term_months_Calculated__c', 'double'), ('Close_Date_Push_Counter__c', 'double'), ('Reason_for_Historic_Record_Type_Details__c', 'string'), ('Authority__c', 'textarea'), ('Bookings_Net_ACV__c', 'currency'), ('Subscription_Term_months__c', 'double'), ('Subscription_Term_years_Calculated__c', 'double'), ('Money__c', 'textarea'), ('Payment_Date_2__c', 'date'), ('Prioritization__c', 'textarea'), ('required_Contact_Roles__c', 'double'), ('Success__c', 'textarea'), ('Define_Org_Chart_Executive_Sponsor__c', 'boolean'), ('Total_Net_ACV_Per_Building__c', 'currency'), ('Additional_sub_meters__c', 'double'), ('Annual_Contract_Value__c', 'currency'), ('Current_infrastructure_identified__c', 'boolean'), ('Marketing_Qualified__c', 'boolean'), ('Opportunity_Source__c', 'string'), ('Prepaid_Subscription__c', 'boolean'), ('Prepaid_Subscription_Amount__c', 'currency'), ('Customer_Success_Manager__c', 'string'), ('Renewal_Comments__c', 'textarea'), ('Funding_Source_Timeline_Determined__c', 'boolean'), ('Tailored_Presentation_Demo__c', 'boolean'), ('Mutual_Close_Plans__c', 'boolean'), ('Competitors_or_Status_Quo__c', 'boolean'), ('Scoping_Meeting_Complete_Scoping_Doc__c', 'boolean'), ('IT_Security_Meeting__c', 'boolean'), ('Pricing_Discussion__c', 'boolean'), ('Procurement_Process_Outlined__c', 'boolean'), ('Statement_of_Work_Completed__c', 'boolean'), ('Proposal_Sent__c', 'boolean'), ('Contract_Review_Meeting__c', 'boolean'), ('Management_Forecast__c', 'picklist'), ('Initial_Qualification_Call__c', 'boolean'), ('Renewal_Who__c', 'textarea'), ('Num_of_Buildings_Qualification__c', 'double'), ('Square_Footage__c', 'double'), ('Annual_Energy_Spend__c', 'currency'), ('Business_Initiative__c', 'textarea'), ('Current_Challenges__c', 'textarea'), ('Current_State__c', 'textarea'), ('Positive_Business_Outdoor__c', 'textarea'), ('Decision_Making_Process__c', 'textarea'), ('Champion__c', 'textarea'), ('Evaluation_Criteria__c', 'textarea'), ('Timeline__c', 'textarea'), ('Budget_Justification_ROI__c', 'textarea'), ('Familiar_w_SaaS__c', 'textarea'), ('Blockers__c', 'textarea'), ('Winning_Losing__c', 'picklist'), ('Executive_Sponsor__c', 'picklist'), ('Account_Business_Relationship__c', 'string'), ('Prequal_to_Qual_Date__c', 'date'), ('LID__LinkedIn_Company_Id__c', 'string'), ('Renewal_What__c', 'textarea'), ('FCRM__FCR_Admin_CMArchive__c', 'textarea'), ('FCRM__FCR_Admin_Originating_Contact__c', 'reference'), ('FCRM__FCR_Admin_Update_Counter__c', 'double'), ('FCRM__FCR_Campaign_Attribution__c', 'string'), ('FCRM__FCR_First_Campaign_Touch__c', 'reference'), ('FCRM__FCR_Last_Campaign_Touch__c', 'reference'), ('FCRM__FCR_Response_ID__c', 'string'), ('Bookings_at_Proposal_Stage__c', 'currency'), ('Bookings_on_Create__c', 'currency'), ('Bookings_at_Qualified_Stage__c', 'currency'), ('Bookings_at_Won__c', 'currency'), ('CFCR_Exclude_From_Campaign_Influence__c', 'boolean'), ('SQO_Date__c', 'date'), ('Count__c', 'double'), ('Amount_at_Proposal_Stage__c', 'currency'), ('Amount_at_Qualified_Stage__c', 'currency'), ('Amount_at_Won__c', 'currency'), ('Amount_on_Create__c', 'currency'), ('Proposal_Date__c', 'date'), ('Opp_Record_Type_Formula__c', 'string'), ('Renewal_When__c', 'date'), ('Closing_Method__c', 'picklist'), ('Standard_Deal__c', 'boolean'), ('PO_Number__c', 'string'), ('ContractNumber__c', 'double'), ('Renewal_Stage__c', 'picklist'), ('Renewal_Stage_Reason__c', 'picklist'), ('Actual_Close_Date__c', 'date'), ('Age_of_Parent_Opportunity__c', 'double'), ('Close_Probability__c', 'percent'), ('Churn_Probability__c', 'percent'), ('Push_Probability__c', 'percent'), ('Close_Forecast__c', 'currency'), ('Push_Forecast__c', 'currency'), ('Churn_Forecast__c', 'currency'), ('Integration_Scope__c', 'multipicklist'), ('Days_Since_Last_Account_Activity__c', 'double'), ('Age_SQO_to_Close__c', 'double'), ('Legal_Approved__c', 'boolean'), ('Unpaid_Subscription_Fees__c', 'currency'), ('Real_Time_Utility_Buildings__c', 'double'), ('Customer_Committed__c', 'date'), ('Support_Plan__c', 'boolean'), ('Additional_Software_License_ID__c', 'textarea'), ('AP_Billing_Email__c', 'email'), ('Amount_with_Tax_and_Shipping_c__c', 'currency'), ('Forecast_Updated_Date__c', 'date'), ('Age_Since_SQO__c', 'double'), ('Real_Time_Data_Points__c', 'double'), ('of_Points_Sold__c', 'double'), ('Sensory_Network__c', 'boolean'), ('Software_License_ID__c', 'textarea'), ('Billing_Zip__c', 'string'), ('Billing_Address_2__c', 'string'), ('Billing_Entity__c', 'textarea'), ('Shipping_Address_1__c', 'string'), ('Shipping_Address_2__c', 'string'), ('Shipping_Address_3__c', 'string'), ('Shipping_City__c', 'string'), ('Shipping_State__c', 'string'), ('Shipping_Zip__c', 'string'), ('Shipping_Country__c', 'string'), ('Opportunity_Owner_Profile__c', 'string'), ('End_Customer__c', 'reference'), ('Perpetual_License_Amount__c', 'currency'), ('DG_Services_Amount__c', 'currency'), ('Key_Contact_from_Customer_side__c', 'string'), ('Project_Name__c', 'string'), ('OLD_Opportunity_ID__c', 'string'), ('Is_DGLux_Imported__c', 'boolean'), ('Account_Name_Formula__c', 'string'), ('Difficulty__c', 'picklist'), ('Amount_with_Tax_and_Shipping_Formula__c', 'currency'), ('Scoping_Status__c', 'picklist'), ('Manual_Building_Notes__c', 'textarea'), ('Energy_Star_Manager_Number_of_Buildings__c', 'double'), ('Custom_Rate_Tariff_Engine_Notes__c', 'textarea'), ('Automated_Utility_Meter_Notes__c', 'textarea'), ('Cloud_Analytic_Point_Notes__c', 'textarea'), ('Automated_Utility_Bill_Interval_Mete__c', 'double'), ('CountOfCSMProduct__c', 'double'), ('Business_Unit__c', 'picklist'), ('Sub_Channel__c', 'picklist'), ('SubscriptionFamilyProducts__c', 'double'), ('Discovery_Date__c', 'date'), ('Solution_Overview_Date__c', 'date'), ('Scoping_Date__c', 'date'), ('Pending_Approval_Date__c', 'date'), ('Tax_amount__c', 'currency'), ('Date_Paid__c', 'date'), ('Reason_Prequalified__c', 'picklist'), ('Tax__c', 'currency'), ('Last_Renewal_Stage__c', 'picklist'), ('Forecast_Renewal__c', 'currency'), ('Forecast_New_Business__c', 'currency'), ('Forecast_Upsell__c', 'currency'), ('DSCORGPKG__Attributed_to_DiscoverOrg__c', 'boolean'), ('DSCORGPKG__Converted_from_Discoverorg_Data__c', 'boolean'), ('saasoptics__auto_process__c', 'boolean'), ('Forecast_New_Business_Upsell__c', 'currency'), ('Pilot__c', 'boolean'), ('Vertical__c', 'string'), ('Implementation_Hardware_Terms__c', 'string'), ('Renewal_Term__c', 'double'), ('Software_Subscription_Terms__c', 'string'), ('Annual_Price_Adjustment__c', 'string'), ('Subscription_Start_Date__c', 'date'), ('Billing_First_Name__c', 'string'), ('Billing_Last_Name__c', 'string'), ('Comp_Payment_Complete__c', 'boolean'), ('Contract_Effective_Date_CED__c', 'date')])}}"

我试着加载它并将其转换为法令:

def _load_metadata(self, metafile):

    if metafile:
      self.metadata = ast.literal_eval(metafile)
      print(self.metadata)
    else:
      self.metadata = {}

但是我遇到这个错误:

ValueError: malformed node or string: <ast.Call object at 0x1099a8460>

我做错了什么?是什么导致了这个错误?

dldeef67

dldeef671#

ast.literal_eval只能计算文本,而不能计算诸如OrderedDict之类的名称。
您可以使用eval函数,而将包含对实际collections.OrderedDict的引用的字典作为globals参数。要防止计算内置函数,请使键__builtins__引用空dict,以便减少滥用的可能性:

from collections import OrderedDict

...

self.metadata = eval(metafile, {'__builtins__': {}, 'OrderedDict': OrderedDict})

相关问题