Before(:all) do
puts "HELLO ALL :D"
end
Run Code Online (Sandbox Code Playgroud)
我的代码有问题:
/spec/factories.rb
require 'faker'
FactoryGirl.define do
factory :booking_error do
booking_id { Faker::Number.number(3).to_i }
error_type_cd BookingError.error_types.values.shuffle.first
process_name Enums::FlightEnum::PROCESSES.keys.shuffle.first
description "DESCRIPTION"
old_value "OLD_STRING"
new_value "NEW_STRING"
end
end
Run Code Online (Sandbox Code Playgroud)
/spec/models/booking_error_spec.rb
require 'spec_helper'
describe BookingError do
before(:all) do
@booking_error = FactoryGirl.build(:booking_error)
@booking_error_types = BookingError.error_types
end
it 'Validating BookingError save.' do
@booking_error.save.should be_true
end
end
Run Code Online (Sandbox Code Playgroud)
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'mysql2' , '0.3.11'
gem 'devise' , '2.2.0.rc'
gem 'devise-encryptable' , '0.1.1'
gem 'unicorn' , '4.5.0'
gem 'kaminari' …Run Code Online (Sandbox Code Playgroud) 我有一个数据框 df ,我想将一些列转换为类别类型。使用 pandas 我可以这样做:
for col in categorical_collist:
df[col] = df[col].astype('category')
Run Code Online (Sandbox Code Playgroud)
我想在 pyspark 中进行列转换。我该怎么做?
我尝试在 pyspark 中使用以下代码。但它在操作过程中没有给出我的预期输出。
from pyspark.sql.types import StringType
for col in categorical_collist:
df = df.withColumn(col, df[col].cast(StringType()))
Run Code Online (Sandbox Code Playgroud) 当我跑步时:
:$ vagrant provision
Run Code Online (Sandbox Code Playgroud)
要么
:$ vagrant up
Run Code Online (Sandbox Code Playgroud)
我有一个错误:
nisevi@localhost processor (master):$ vagrant provision
Using ssh deploy key of: /home/nisevi/.ssh/id_rsa
==> default: Chef 12.0.3 Omnibus package is already installed.
==> default: Running provisioner: shell...
default: Running: inline script
==> default: W
==> default: :
==> default: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ trusty-security/multiverse amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiverse_binary-amd64_Packages)
==> default: W
==> default: : Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ trusty-security/multiverse i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiverse_binary-i386_Packages)
==> default: W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_multiverse_binary-amd64_Packages)
==> …Run Code Online (Sandbox Code Playgroud) 我能够处理令牌,如果它作为查询字符串在URL中出现,或者如果它出现在标题中Authentication,并且令牌前缀为令牌Bearer,我只希望能够在标题中接收它.
这是我的app/Http/Controllers/API/V1/AuthenticationController.php档案:
<?php
namespace app\Http\Controllers\API\V1;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Tymon\JWTAuth\Exceptions\JWTException;
use App\Models\Role;
use App\Models\User;
use App\Traits\Controllers\ApiParseBody;
use App\Traits\Controllers\ApiException;
use App\Traits\Controllers\ApiEvaluateCredentials;
use Tymon\JWTAuth\JWTAuth;
use App\Exceptions\Unauthorized\InvalidCredentials;
use App\Exceptions\InternalServerError\CouldNotCreateToken;
use Illuminate\Contracts\Hashing\Hasher;
class AuthenticationController extends Controller
{
use ApiParseBody;
use ApiEvaluateCredentials;
use ApiException;
/**
* The user implementation.
*
* @var User
*/
protected $user;
/**
* The role implementation.
*
* @var Role
*/
protected $role;
/**
* The hash implementation.
*
* @var Hash
*/ …Run Code Online (Sandbox Code Playgroud) ruby ×2
apache-spark ×1
chef-infra ×1
chef-solo ×1
cors ×1
factory ×1
factory-bot ×1
jwt ×1
laravel ×1
laravel-5.3 ×1
pandas ×1
pyspark ×1
rspec ×1
types ×1
vagrant ×1
vagrantfile ×1